Messages in this thread | | | Date | Mon, 25 Jul 2011 13:38:11 -0400 | From | Ted Ts'o <> | Subject | Re: [PATCH] fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers |
| |
On Wed, Jun 29, 2011 at 02:05:16PM -0400, Josef Bacik wrote: > diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c > index ce66d2f..da3bed3 100644 > --- a/fs/ext4/fsync.c > +++ b/fs/ext4/fsync.c > @@ -151,6 +151,32 @@ static int ext4_sync_parent(struct inode *inode) > return ret; > } > > +/** > + * __sync_file - generic_file_fsync without the locking and filemap_write > + * @inode: inode to sync > + * @datasync: only sync essential metadata if true > + * > + * This is just generic_file_fsync without the locking. This is needed for > + * nojournal mode to make sure this inodes data/metadata makes it to disk > + * properly. The i_mutex should be held already. > + */ > +static int __sync_inode(struct inode *inode, int datasync)
The comment calls this __sync_file, instead of __sync_inode.
Maybe it would be better to define a generic_file_fsync_nolock() in fs/libfs.c and then have generic_file_fsync() call the _nolock() function? That way we don't have the code duplicated in two different places, and eventually risking it going out of sync with each other.
- Ted
| |