-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
252 changed files
with
14,977 additions
and
10,620 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,36 @@ | ||
package org.opendedup.buse.driver; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
public interface BUSE { | ||
public int read(ByteBuffer data, int len, long offset); | ||
|
||
public int write(ByteBuffer buff, int len, long offset); | ||
|
||
public void disconnect(); | ||
|
||
public int flush(); | ||
|
||
public int trim(long from, int len); | ||
|
||
public void close(); | ||
|
||
} | ||
/******************************************************************************* | ||
* Copyright (C) 2016 Sam Silverberg [email protected] | ||
* | ||
* This file is part of OpenDedupe SDFS. | ||
* | ||
* OpenDedupe SDFS is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* OpenDedupe SDFS is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Foobar. If not, see <http://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
package org.opendedup.buse.driver; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
public interface BUSE { | ||
public int read(ByteBuffer data, int len, long offset); | ||
|
||
public int write(ByteBuffer buff, int len, long offset); | ||
|
||
public void disconnect(); | ||
|
||
public int flush(); | ||
|
||
public int trim(long from, int len); | ||
|
||
public void close(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,65 @@ | ||
package org.opendedup.buse.driver; | ||
|
||
import java.util.logging.Logger; | ||
|
||
public class BUSEMkDev { | ||
|
||
private static Logger log = Logger.getLogger(BUSEMkDev.class.getName()); | ||
|
||
static { | ||
System.loadLibrary("jbuse"); | ||
} | ||
|
||
public static int startdev(final String dev, long sz, int blksz, BUSE buse, | ||
boolean readonly) throws Exception { | ||
|
||
log.info("Mounted filesystem"); | ||
// ShutdownHook t = new ShutdownHook(dev,buse); | ||
// Runtime.getRuntime().addShutdownHook(t); | ||
int z = mkdev(dev, sz, blksz, buse, readonly); | ||
|
||
log.info("Filesystem is unmounted"); | ||
return z; | ||
} | ||
|
||
public static void closeDev(final String dev) throws Exception { | ||
closedev(dev); | ||
} | ||
|
||
public static void init() { | ||
ThreadGroup threadGroup = new ThreadGroup(Thread.currentThread() | ||
.getThreadGroup(), "BUSE Threads"); | ||
threadGroup.setDaemon(true); | ||
init(threadGroup); | ||
} | ||
|
||
private static native int mkdev(String dev, long sz, int blksz, BUSE buse, | ||
boolean readonly) throws Exception; | ||
|
||
private static native void closedev(String dev) throws Exception; | ||
|
||
private static native void init(ThreadGroup threadGroup); | ||
|
||
public static native void release(); | ||
|
||
public static native void setSize(String dev, long sz); | ||
|
||
} | ||
/******************************************************************************* | ||
* Copyright (C) 2016 Sam Silverberg [email protected] | ||
* | ||
* This file is part of OpenDedupe SDFS. | ||
* | ||
* OpenDedupe SDFS is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* OpenDedupe SDFS is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Foobar. If not, see <http://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
package org.opendedup.buse.driver; | ||
|
||
import java.util.logging.Logger; | ||
|
||
public class BUSEMkDev { | ||
|
||
private static Logger log = Logger.getLogger(BUSEMkDev.class.getName()); | ||
|
||
static { | ||
System.loadLibrary("jbuse"); | ||
} | ||
|
||
public static int startdev(final String dev, long sz, int blksz, BUSE buse, | ||
boolean readonly) throws Exception { | ||
|
||
log.info("Mounted filesystem"); | ||
// ShutdownHook t = new ShutdownHook(dev,buse); | ||
// Runtime.getRuntime().addShutdownHook(t); | ||
int z = mkdev(dev, sz, blksz, buse, readonly); | ||
|
||
log.info("Filesystem is unmounted"); | ||
return z; | ||
} | ||
|
||
public static void closeDev(final String dev) throws Exception { | ||
closedev(dev); | ||
} | ||
|
||
public static void init() { | ||
ThreadGroup threadGroup = new ThreadGroup(Thread.currentThread() | ||
.getThreadGroup(), "BUSE Threads"); | ||
threadGroup.setDaemon(true); | ||
init(threadGroup); | ||
} | ||
|
||
private static native int mkdev(String dev, long sz, int blksz, BUSE buse, | ||
boolean readonly) throws Exception; | ||
|
||
private static native void closedev(String dev) throws Exception; | ||
|
||
private static native void init(ThreadGroup threadGroup); | ||
|
||
public static native void release(); | ||
|
||
public static native void setSize(String dev, long sz); | ||
|
||
} |
Oops, something went wrong.