[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110725173811.GJ3469@thunk.org>
Date: Mon, 25 Jul 2011 13:38:11 -0400
From: Ted Ts'o <tytso@....edu>
To: Josef Bacik <josef@...hat.com>
Cc: linux-fsdevel@...r.kernel.org, hch@...radead.org,
viro@...iv.linux.org.uk, jack@...e.cz, linux-kernel@...r.kernel.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists