Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / hostfs / hostfs_user.c
index 16974dc..23b7cee 100644 (file)
@@ -28,10 +28,7 @@ int stat_file(const char *path, unsigned long long *inode_out, int *mode_out,
        if(lstat64(path, &buf) < 0)
                return(-errno);
 
-       /* See the Makefile for why STAT64_INO_FIELD is passed in
-        * by the build
-        */
-       if(inode_out != NULL) *inode_out = buf.STAT64_INO_FIELD;
+       if(inode_out != NULL) *inode_out = buf.st_ino;
        if(mode_out != NULL) *mode_out = buf.st_mode;
        if(nlink_out != NULL) *nlink_out = buf.st_nlink;
        if(uid_out != NULL) *uid_out = buf.st_uid;
@@ -156,10 +153,24 @@ int lseek_file(int fd, long long offset, int whence)
        int ret;
 
        ret = lseek64(fd, offset, whence);
-       if(ret < 0) return(-errno);
+       if(ret < 0)
+               return(-errno);
        return(0);
 }
 
+int fsync_file(int fd, int datasync)
+{
+       int ret;
+       if (datasync)
+               ret = fdatasync(fd);
+       else
+               ret = fsync(fd);
+
+       if (ret < 0)
+               return -errno;
+       return 0;
+}
+
 void close_file(void *stream)
 {
        close(*((int *) stream));
@@ -349,7 +360,6 @@ int do_statfs(char *root, long *bsize_out, long long *blocks_out,
        spare_out[2] = buf.f_spare[2];
        spare_out[3] = buf.f_spare[3];
        spare_out[4] = buf.f_spare[4];
-       spare_out[5] = buf.f_spare[5];
        return(0);
 }