lkml.org 
[lkml]   [2011]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2011-07-25 19:41    [W:0.449 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site