drop unused dentry argument to ->fsync
[safe/jmp/linux-2.6] / fs / exofs / file.c
index c681003..fef6899 100644 (file)
@@ -40,26 +40,32 @@ static int exofs_release_file(struct inode *inode, struct file *filp)
        return 0;
 }
 
-static int exofs_file_fsync(struct file *filp, struct dentry *dentry,
-                           int datasync)
+static int exofs_file_fsync(struct file *filp, int datasync)
 {
        int ret;
        struct address_space *mapping = filp->f_mapping;
+       struct inode *inode = mapping->host;
+       struct super_block *sb;
 
        ret = filemap_write_and_wait(mapping);
        if (ret)
                return ret;
 
-       /*Note: file_fsync below also calles sync_blockdev, which is a no-op
-        *      for exofs, but other then that it does sync_inode and
-        *      sync_superblock which is what we need here.
-        */
-       return file_fsync(filp, dentry, datasync);
+       /* sync the inode attributes */
+       ret = write_inode_now(inode, 1);
+
+       /* This is a good place to write the sb */
+       /* TODO: Sechedule an sb-sync on create */
+       sb = inode->i_sb;
+       if (sb->s_dirt)
+               exofs_sync_fs(sb, 1);
+
+       return ret;
 }
 
 static int exofs_flush(struct file *file, fl_owner_t id)
 {
-       exofs_file_fsync(file, file->f_path.dentry, 1);
+       exofs_file_fsync(file, 1);
        /* TODO: Flush the OSD target */
        return 0;
 }