diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2009-06-14 09:52:10 -0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2009-06-21 10:53:47 -0400 |
commit | baaf94cdc7fe1c61e3c660a3b055724fd9d0a034 (patch) | |
tree | b6f1704f38e39801df39b231e19b514d3b4b0ddf /fs/exofs | |
parent | 27d2e1491985e95c486d991302e399f5c584b4eb (diff) |
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')
-rw-r--r-- | fs/exofs/exofs.h | 3 | ||||
-rw-r--r-- | fs/exofs/file.c | 17 | ||||
-rw-r--r-- | fs/exofs/super.c | 2 |
3 files changed, 16 insertions, 6 deletions
diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h index c413b74ecf31..5ec72e020b22 100644 --- a/fs/exofs/exofs.h +++ b/fs/exofs/exofs.h | |||
@@ -154,6 +154,9 @@ ino_t exofs_parent_ino(struct dentry *child); | |||
154 | int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *, | 154 | int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *, |
155 | struct inode *); | 155 | struct inode *); |
156 | 156 | ||
157 | /* super.c */ | ||
158 | int exofs_sync_fs(struct super_block *sb, int wait); | ||
159 | |||
157 | /********************* | 160 | /********************* |
158 | * operation vectors * | 161 | * operation vectors * |
159 | *********************/ | 162 | *********************/ |
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, | |||
45 | { | 45 | { |
46 | int ret; | 46 | int ret; |
47 | struct address_space *mapping = filp->f_mapping; | 47 | struct address_space *mapping = filp->f_mapping; |
48 | struct inode *inode = dentry->d_inode; | ||
49 | struct super_block *sb; | ||
48 | 50 | ||
49 | ret = filemap_write_and_wait(mapping); | 51 | ret = filemap_write_and_wait(mapping); |
50 | if (ret) | 52 | if (ret) |
51 | return ret; | 53 | return ret; |
52 | 54 | ||
53 | /*Note: file_fsync below also calles sync_blockdev, which is a no-op | 55 | /* sync the inode attributes */ |
54 | * for exofs, but other then that it does sync_inode and | 56 | ret = write_inode_now(inode, 1); |
55 | * sync_superblock which is what we need here. | 57 | |
56 | */ | 58 | /* This is a good place to write the sb */ |
57 | return file_fsync(filp, dentry, datasync); | 59 | /* TODO: Sechedule an sb-sync on create */ |
60 | sb = inode->i_sb; | ||
61 | if (sb->s_dirt) | ||
62 | exofs_sync_fs(sb, 1); | ||
63 | |||
64 | return ret; | ||
58 | } | 65 | } |
59 | 66 | ||
60 | static int exofs_flush(struct file *file, fl_owner_t id) | 67 | static int exofs_flush(struct file *file, fl_owner_t id) |
diff --git a/fs/exofs/super.c b/fs/exofs/super.c index e47b38e55a26..a343b4ea62f6 100644 --- a/fs/exofs/super.c +++ b/fs/exofs/super.c | |||
@@ -198,7 +198,7 @@ static const struct export_operations exofs_export_ops; | |||
198 | /* | 198 | /* |
199 | * Write the superblock to the OSD | 199 | * Write the superblock to the OSD |
200 | */ | 200 | */ |
201 | static int exofs_sync_fs(struct super_block *sb, int wait) | 201 | int exofs_sync_fs(struct super_block *sb, int wait) |
202 | { | 202 | { |
203 | struct exofs_sb_info *sbi; | 203 | struct exofs_sb_info *sbi; |
204 | struct exofs_fscb *fscb; | 204 | struct exofs_fscb *fscb; |