Commits

Etienne Perot committed 9b3ac2c

Add datasync parameter to fsync/fsyncdir, update stat struct from fuse.py

  • Participants
  • Parent commits 9dab949

Comments (0)

Files changed (6)

File src/net/fusejna/FuseFilesystem.java

 	}
 
 	@FuseMethod
-	final int _fsync(final String path, final StructFuseFileInfo info)
+	final int _fsync(final String path, final int datasync, final StructFuseFileInfo info)
 	{
-		return fsync(path, new FileInfoWrapper(path, info));
+		return fsync(path, datasync, new FileInfoWrapper(path, info));
 	}
 
 	@FuseMethod
-	final int _fsyncdir(final String path, final StructFuseFileInfo info)
+	final int _fsyncdir(final String path, final int datasync, final StructFuseFileInfo info)
 	{
 		final FileInfoWrapper wrapper = new FileInfoWrapper(path, info);
-		final int result = fsyncdir(path, wrapper);
+		final int result = fsyncdir(path, datasync, wrapper);
 		wrapper.write();
 		return result;
 	}
 	public abstract int flush(final String path, final FileInfoWrapper info);
 
 	@UserMethod
-	public abstract int fsync(final String path, final FileInfoWrapper info);
+	public abstract int fsync(final String path, int datasync, final FileInfoWrapper info);
 
 	@UserMethod
-	public abstract int fsyncdir(final String path, final FileInfoWrapper info);
+	public abstract int fsyncdir(final String path, int datasync, final FileInfoWrapper info);
 
 	@UserMethod
 	public abstract int ftruncate(final String path, final long offset, final FileInfoWrapper info);

File src/net/fusejna/LoggedFuseFilesystem.java

 	}
 
 	@Override
-	public int fsync(final String path, final FileInfoWrapper info)
+	public int fsync(final String path, final int datasync, final FileInfoWrapper info)
 	{
 		return log("flush", 0, new LoggedMethod<Integer>()
 		{
 			@Override
 			public Integer invoke()
 			{
-				return filesystem.fsync(path, info);
+				return filesystem.fsync(path, datasync, info);
 			}
 		}, path, info);
 	}
 
 	@Override
-	public int fsyncdir(final String path, final FileInfoWrapper info)
+	public int fsyncdir(final String path, final int datasync, final FileInfoWrapper info)
 	{
 		return log("fsyncdir", 0, new LoggedMethod<Integer>()
 		{
 			@Override
 			public Integer invoke()
 			{
-				return filesystem.fsyncdir(path, info);
+				return filesystem.fsyncdir(path, datasync, info);
 			}
 		}, path, info);
 	}

File src/net/fusejna/StructFuseOperations.java

 		};
 		fsync = new Callback()
 		{
-			public final int callback(final String path, final StructFuseFileInfo.ByReference info)
+			public final int callback(final String path, final int datasync, final StructFuseFileInfo.ByReference info)
 			{
-				return filesystem._fsync(path, info);
+				return filesystem._fsync(path, datasync, info);
 			}
 		};
 		switch (Platform.platform()) {
 		};
 		fsyncdir = new Callback()
 		{
-			public final int callback(final String path, final StructFuseFileInfo.ByReference info)
+			public final int callback(final String path, final int datasync, final StructFuseFileInfo.ByReference info)
 			{
-				return filesystem._fsyncdir(path, info);
+				return filesystem._fsyncdir(path, datasync, info);
 			}
 		};
 		init = new Callback()

File src/net/fusejna/StructStat.java

 import net.fusejna.types.TypeNLink;
 import net.fusejna.types.TypeOff;
 import net.fusejna.types.TypeQspare;
+import net.fusejna.types.TypeUInt32;
 import net.fusejna.types.TypeUid;
 
 import com.sun.jna.Structure;
 		}
 
 		public TypeDev st_dev;
-		public short __pad0;
-		public TypeIno __pad1;
+		public short __pad1;
+		public TypeUInt32 __st_ino;
 		public TypeMode st_mode;
 		public TypeNLink st_nlink;
 		public TypeUid st_uid;

File src/net/fusejna/types/TypeSize.java

 				size = 8;
 				break;
 			case LINUX_I686:
+				size = 4;
+				break;
 			case LINUX_PPC:
 			case LINUX_X86_64:
 				size = Platform.size(TypeLongLong.class);

File src/net/fusejna/util/FuseFilesystemAdapterFull.java

 	}
 
 	@Override
-	public int fsync(final String path, final FileInfoWrapper info)
+	public int fsync(final String path, final int datasync, final FileInfoWrapper info)
 	{
 		return 0;
 	}
 
 	@Override
-	public int fsyncdir(final String path, final FileInfoWrapper info)
+	public int fsyncdir(final String path, final int datasync, final FileInfoWrapper info)
 	{
 		return 0;
 	}