Skip to content

Commit

Permalink
3.3.9 changes
Browse files Browse the repository at this point in the history
Fixed caching
  • Loading branch information
opendedup committed Feb 4, 2017
1 parent 432fa1b commit eca8531
Show file tree
Hide file tree
Showing 44 changed files with 4,379 additions and 783 deletions.
2 changes: 2 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding//src/org/opendedup/util/Ascii85.java=UTF-8
Binary file not shown.
Binary file modified install-packages/deb/usr/share/sdfs/lib/rabin.jar
Binary file not shown.
Binary file modified install-packages/deb/usr/share/sdfs/lib/sdfs.jar
Binary file not shown.
6 changes: 5 additions & 1 deletion jfuse/src/jni/javafs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,11 @@ JNIEXPORT void JNICALL Java_fuse_FuseMount_mount(JNIEnv *env, jclass class, jobj
{
// main loop
fuse_main(fuseArgc, fuseArgv, &javafs_oper);

while (1)
{
(*env)->CallVoidMethod(env, fuseFS, FuseFS->method.destroy);
break;
}
// cleanup
free_threadGroup(env);
}
Expand Down
72 changes: 32 additions & 40 deletions src/fuse/SDFS/SDFSFileSystem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fuse.SDFS;

import java.io.File;

import java.io.IOException;
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
Expand All @@ -11,8 +12,6 @@
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.nio.file.attribute.UserDefinedFileAttributeView;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

import java.util.concurrent.locks.ReentrantLock;
Expand Down Expand Up @@ -897,17 +896,15 @@ public int getxattr(String path, String name, ByteBuffer dst) throws FuseExcepti
dst.put(sdfsCmds.getAttr(name, path).getBytes());
else {
File f = this.resolvePath(path);
Path _p = f.toPath();
UserDefinedFileAttributeView view = Files.getFileAttributeView(_p,
UserDefinedFileAttributeView.class);
view.read(name, dst);
MetaDataDedupFile mf = MetaFileStore.getMF(f);
String st = mf.getXAttribute(name);
if(st != null)
dst.put(st.getBytes());
else
throw new FuseException().initErrno(Errno.ENODATA);

}
}
} catch (java.nio.file.FileSystemException e) {
if (SDFSLogger.isDebug())
SDFSLogger.getLog().debug("error getting exattr for " + path, e);
throw new FuseException().initErrno(Errno.ENODATA);
} catch (Exception e) {
SDFSLogger.getLog().error("error getting exattr for " + path, e);
throw new FuseException().initErrno(Errno.ENODATA);
Expand All @@ -930,16 +927,16 @@ public int getxattrsize(String path, String name, FuseSizeSetter sizeSetter) thr
} else {
File f = this.resolvePath(path);

Path _p = f.toPath();
UserDefinedFileAttributeView view = Files.getFileAttributeView(_p, UserDefinedFileAttributeView.class);
sizeSetter.setSize(view.size(name));
MetaDataDedupFile mf = MetaFileStore.getMF(f);
String st = mf.getXAttribute(name);
if(st != null)
sizeSetter.setSize(st.getBytes().length);
else
throw new FuseException().initErrno(Errno.ENODATA);


}

} catch (java.nio.file.FileSystemException e) {
if (SDFSLogger.isDebug())
SDFSLogger.getLog().debug("error getting exattr for " + path, e);
throw new FuseException().initErrno(Errno.ENODATA);
} catch (Exception e) {
SDFSLogger.getLog().error("error getting exattr for " + path, e);
throw new FuseException().initErrno(Errno.ENODATA);
Expand All @@ -955,10 +952,8 @@ public int listxattr(String path, XattrLister lister) throws FuseException {
File f = this.resolvePath(path);
if (!f.exists())
throw new FuseException().initErrno(Errno.ENFILE);
Path _p = f.toPath();
UserDefinedFileAttributeView view = Files.getFileAttributeView(_p, UserDefinedFileAttributeView.class);
List<String> l = view.list();
for (String s : l) {
MetaDataDedupFile mf = MetaFileStore.getMF(f);
for (String s : mf.getXAttersNames()) {
lister.add(s);
}

Expand All @@ -974,7 +969,11 @@ public int listxattr(String path, XattrLister lister) throws FuseException {
@Override
public int removexattr(String path, String name) throws FuseException {
try {

File f = this.resolvePath(path);
if (!f.exists())
throw new FuseException().initErrno(Errno.ENFILE);
MetaDataDedupFile mf = MetaFileStore.getMF(f);
mf.removeXAttribute(name);
} finally {
}
return 0;
Expand All @@ -992,13 +991,10 @@ public int setxattr(String path, String name, ByteBuffer value, int flags) throw
sdfsCmds.runCMD(path, name, valStr);
} else {
File f = this.resolvePath(path);
Path _path = f.toPath();
UserDefinedFileAttributeView view = Files.getFileAttributeView(_path,
UserDefinedFileAttributeView.class);
view.write(name, value);
MetaDataDedupFile mf = MetaFileStore.getMF(f);
mf.addXAttribute(name, valStr);
if (SDFSLogger.isDebug())
SDFSLogger.getLog().debug("set " + name + " to " + valStr);
MetaDataDedupFile mf = MetaFileStore.getMF(f);
if (mf.isFile())
mf.setDirty(true);
eventBus.post(new MFileWritten(mf));
Expand Down Expand Up @@ -1026,18 +1022,17 @@ public int getxattr(String path, String name, ByteBuffer dst, int position)
dst.put(sdfsCmds.getAttr(name, path).getBytes());
else {
File f = this.resolvePath(path);
Path _p = f.toPath();
UserDefinedFileAttributeView view = Files.getFileAttributeView(_p,
UserDefinedFileAttributeView.class);
view.read(name, dst);
MetaDataDedupFile mf = MetaFileStore.getMF(f);
String st = mf.getXAttribute(name);
if(st != null)
dst.put(st.getBytes());
else
throw new FuseException().initErrno(Errno.ENODATA);


}
}
} catch (java.nio.file.FileSystemException e) {
if (SDFSLogger.isDebug())
SDFSLogger.getLog().debug("error getting exattr for " + path, e);
throw new FuseException().initErrno(Errno.ENODATA);
} catch (FuseException e) {
} catch (FuseException e) {
throw e;
} catch (Exception e) {
SDFSLogger.getLog().error("error getting exattr for " + path, e);
Expand All @@ -1060,11 +1055,8 @@ public int setxattr(String path, String name, ByteBuffer value, int flags, int p
sdfsCmds.runCMD(path, name, valStr);
} else {
File f = this.resolvePath(path);
Path _path = f.toPath();
UserDefinedFileAttributeView view = Files.getFileAttributeView(_path,
UserDefinedFileAttributeView.class);
view.write(name, value);
MetaDataDedupFile mf = MetaFileStore.getMF(f);
mf.addXAttribute(name, valStr);
if (mf.isFile())
mf.setDirty(true);
eventBus.post(new MFileWritten(mf));
Expand Down
1 change: 1 addition & 0 deletions src/org/opendedup/collections/LongByteArrayMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.io.File;


import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.BufferUnderflowException;
Expand Down
Loading

0 comments on commit eca8531

Please sign in to comment.