From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: [PATCH] exofs: Avoid using file_fsync() Date: Mon, 15 Jun 2009 16:31:01 +0300 Message-ID: <4A364D15.1080105@panasas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Christoph Hellwig , Al Viro To: open-osd mailing-list , linux-fsdevel Return-path: Received: from ip67-152-220-66.z220-152-67.customer.algx.net ([67.152.220.66]:11862 "EHLO daytona.int.panasas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752519AbZFONbD (ORCPT ); Mon, 15 Jun 2009 09:31:03 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Please review the below patch. I will try to push it through the exofs tree for 2.6.31 --- Subject: [PATCH] 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 --- fs/exofs/file.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/fs/exofs/file.c b/fs/exofs/file.c index 6ed7fe4..9e60d68 100644 --- a/fs/exofs/file.c +++ b/fs/exofs/file.c @@ -47,16 +47,24 @@ 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, 0); + + /* This is a good place to write the sb */ + /* TODO: Sechedule an sb-sync on create */ + sb = inode->i_sb; + lock_super(sb); + if (sb->s_dirt && sb->s_op->write_super) + sb->s_op->write_super(sb); + unlock_super(sb); + return ret; } static int exofs_flush(struct file *file, fl_owner_t id) -- 1.6.2.1