From af9800015e9eb7da6ada1a71e9dd1beaee3a6b2b Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Sun, 14 Jun 2009 16:52:10 +0300 Subject: [PATCH] --- yaml --- r: 155275 b: refs/heads/master c: baaf94cdc7fe1c61e3c660a3b055724fd9d0a034 h: refs/heads/master i: 155273: 1a01e13eeb839a79a9c2b8ff6b3cffdde11e2ccd 155271: c9b7af69b57a18be0cfe5cea25deed2562695fff v: v3 --- [refs] | 2 +- trunk/fs/exofs/exofs.h | 3 +++ trunk/fs/exofs/file.c | 17 ++++++++++++----- trunk/fs/exofs/super.c | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 59616e018817..65ca95be12de 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 27d2e1491985e95c486d991302e399f5c584b4eb +refs/heads/master: baaf94cdc7fe1c61e3c660a3b055724fd9d0a034 diff --git a/trunk/fs/exofs/exofs.h b/trunk/fs/exofs/exofs.h index c413b74ecf31..5ec72e020b22 100644 --- a/trunk/fs/exofs/exofs.h +++ b/trunk/fs/exofs/exofs.h @@ -154,6 +154,9 @@ ino_t exofs_parent_ino(struct dentry *child); int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *, struct inode *); +/* super.c */ +int exofs_sync_fs(struct super_block *sb, int wait); + /********************* * operation vectors * *********************/ diff --git a/trunk/fs/exofs/file.c b/trunk/fs/exofs/file.c index c6810038d637..839b9dc1e70f 100644 --- a/trunk/fs/exofs/file.c +++ b/trunk/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) diff --git a/trunk/fs/exofs/super.c b/trunk/fs/exofs/super.c index e47b38e55a26..a343b4ea62f6 100644 --- a/trunk/fs/exofs/super.c +++ b/trunk/fs/exofs/super.c @@ -198,7 +198,7 @@ static const struct export_operations exofs_export_ops; /* * 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_fscb *fscb;