From: Boaz Harrosh <bharrosh@panasas.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: exofs_file_fsync
Date: Mon, 31 May 2010 16:43:48 +0300 [thread overview]
Message-ID: <4C03BD14.5030004@panasas.com> (raw)
In-Reply-To: <20100531103349.GA12196@lst.de>
On 05/31/2010 01:33 PM, Christoph Hellwig wrote:
> On Mon, May 31, 2010 at 01:31:01PM +0300, Boaz Harrosh wrote:
>> OK, I was just looking at that. thanks you saved me some digging.
>> should I just open-code the generic_file_fsync minus the blocks
>> thing then?
>
> sync_mapping_buffers is a no-op for you so you can keep it.
> The other difference is that you sync out the superblock at the
> end of your fsync implementation. That is rather unusual, but I don't
> know enough about exofs if you really need to update data in the
> superblock to commit file data to disk.
>
>> I'm busy with the truncate stuff, but I'll do this next.
>> Do you need this ASAP?
>
> I just noticed it while walking through the fsync implementations.
>
OK Chritoff I would need your help Please.
It looks like what I need exactly is:
write_inode_now(inode, sync)
But write_inode_now() has one extra hunk over generic_file_fsync:
if (sync)
inode_sync_wait(inode);
Do you think I can get in trouble calling it from ->fsync
I don't like generic_file_fsync because it does not write my
data since I don't have buffer_heads.
OK, I'm totally lost what does ->fsync need to do? only write
the inode or the pages as well?
Boaz
---
git diff --stat -p -M fs/exofs/file.c
fs/exofs/file.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/exofs/file.c b/fs/exofs/file.c
index f9bfe2b..9b3555e 100644
--- a/fs/exofs/file.c
+++ b/fs/exofs/file.c
@@ -47,18 +47,14 @@ static int exofs_file_fsync(struct file *filp, int datasync)
struct inode *inode = mapping->host;
struct super_block *sb;
- ret = filemap_write_and_wait(mapping);
- if (ret)
- return ret;
-
/* sync the inode attributes */
- ret = write_inode_now(inode, 1);
+ ret = write_inode_now(inode, datasync);
/* 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);
+ exofs_sync_fs(sb, datasync);
return ret;
}
next prev parent reply other threads:[~2010-05-31 13:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-31 10:09 exofs_file_fsync Christoph Hellwig
2010-05-31 10:23 ` exofs_file_fsync Boaz Harrosh
2010-05-31 10:27 ` exofs_file_fsync Christoph Hellwig
2010-05-31 10:31 ` exofs_file_fsync Boaz Harrosh
2010-05-31 10:33 ` exofs_file_fsync Christoph Hellwig
2010-05-31 13:43 ` Boaz Harrosh [this message]
2010-05-31 13:46 ` exofs_file_fsync Boaz Harrosh
2010-06-01 10:05 ` exofs_file_fsync Christoph Hellwig
2010-06-01 10:04 ` exofs_file_fsync Christoph Hellwig
2010-06-01 15:29 ` exofs_file_fsync Boaz Harrosh
2010-06-01 15:30 ` [PATCH] exofs: exofs_file_fsync correctness Boaz Harrosh
2010-06-01 15:33 ` [osd-dev] " Boaz Harrosh
2010-06-01 15:34 ` Christoph Hellwig
2010-06-01 15:40 ` Boaz Harrosh
2010-06-01 15:47 ` Christoph Hellwig
2010-06-01 16:10 ` Boaz Harrosh
2010-06-01 16:11 ` [PATCH ver2] exofs: exofs_file_fsync and exofs_file_flush correctness Boaz Harrosh
2010-06-01 16:17 ` Christoph Hellwig
2010-06-01 16:36 ` Boaz Harrosh
2010-06-01 17:03 ` [PATCH ver3] " Boaz Harrosh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C03BD14.5030004@panasas.com \
--to=bharrosh@panasas.com \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.