summaryrefslogtreecommitdiff
path: root/fs/exofs/file.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2009-06-14 17:52:10 +0400
committerBoaz Harrosh <bharrosh@panasas.com>2009-06-21 18:53:47 +0400
commitbaaf94cdc7fe1c61e3c660a3b055724fd9d0a034 (patch)
treeb6f1704f38e39801df39b231e19b514d3b4b0ddf /fs/exofs/file.c
parent27d2e1491985e95c486d991302e399f5c584b4eb (diff)
downloadlinux-baaf94cdc7fe1c61e3c660a3b055724fd9d0a034.tar.xz
exofs: Avoid using file_fsync()
The use of file_fsync() in exofs_file_sync() is not necessary since it does some extra stuff not used by exofs. Open code just the parts that are currently needed. TODO: Farther optimization can be done to sync the sb only on inode update of new files, Usually the sb update is not needed in exofs. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/file.c')
-rw-r--r--fs/exofs/file.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/exofs/file.c b/fs/exofs/file.c
index c6810038d637..839b9dc1e70f 100644
--- a/fs/exofs/file.c
+++ b/fs/exofs/file.c
@@ -45,16 +45,23 @@ static int exofs_file_fsync(struct file *filp, struct dentry *dentry,
{
int ret;
struct address_space *mapping = filp->f_mapping;
+ struct inode *inode = dentry->d_inode;
+ 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)