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>wifi-calibration
parent
27d2e14919
commit
baaf94cdc7
|
@ -154,6 +154,9 @@ ino_t exofs_parent_ino(struct dentry *child);
|
||||||
int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *,
|
int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *,
|
||||||
struct inode *);
|
struct inode *);
|
||||||
|
|
||||||
|
/* super.c */
|
||||||
|
int exofs_sync_fs(struct super_block *sb, int wait);
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* operation vectors *
|
* operation vectors *
|
||||||
*********************/
|
*********************/
|
||||||
|
|
|
@ -45,16 +45,23 @@ static int exofs_file_fsync(struct file *filp, struct dentry *dentry,
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct address_space *mapping = filp->f_mapping;
|
struct address_space *mapping = filp->f_mapping;
|
||||||
|
struct inode *inode = dentry->d_inode;
|
||||||
|
struct super_block *sb;
|
||||||
|
|
||||||
ret = filemap_write_and_wait(mapping);
|
ret = filemap_write_and_wait(mapping);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/*Note: file_fsync below also calles sync_blockdev, which is a no-op
|
/* sync the inode attributes */
|
||||||
* for exofs, but other then that it does sync_inode and
|
ret = write_inode_now(inode, 1);
|
||||||
* sync_superblock which is what we need here.
|
|
||||||
*/
|
/* This is a good place to write the sb */
|
||||||
return file_fsync(filp, dentry, datasync);
|
/* 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)
|
static int exofs_flush(struct file *file, fl_owner_t id)
|
||||||
|
|
|
@ -198,7 +198,7 @@ static const struct export_operations exofs_export_ops;
|
||||||
/*
|
/*
|
||||||
* Write the superblock to the OSD
|
* Write the superblock to the OSD
|
||||||
*/
|
*/
|
||||||
static int exofs_sync_fs(struct super_block *sb, int wait)
|
int exofs_sync_fs(struct super_block *sb, int wait)
|
||||||
{
|
{
|
||||||
struct exofs_sb_info *sbi;
|
struct exofs_sb_info *sbi;
|
||||||
struct exofs_fscb *fscb;
|
struct exofs_fscb *fscb;
|
||||||
|
|
Loading…
Reference in New Issue