[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090827173540.GA19115@infradead.org>
Date: Thu, 27 Aug 2009 13:35:40 -0400
From: Christoph Hellwig <hch@...radead.org>
To: Jan Kara <jack@...e.cz>
Cc: LKML <linux-kernel@...r.kernel.org>, hch@....de,
linux-fsdevel@...r.kernel.org, Evgeniy Polyakov <zbr@...emap.net>,
ocfs2-devel@....oracle.com, Joel Becker <joel.becker@...cle.com>,
Felix Blyakher <felixb@....com>, xfs@....sgi.com,
Anton Altaparmakov <aia21@...tab.net>,
linux-ntfs-dev@...ts.sourceforge.net,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
linux-ext4@...r.kernel.org, tytso@....edu
Subject: Re: [PATCH 07/17] vfs: Introduce new helpers for syncing after
writing to O_SYNC file or IS_SYNC inode
> +int generic_write_sync(struct file *file, loff_t pos, loff_t count)
> +{
> + if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host))
> + return 0;
> + return generic_sync_file(file, file->f_path.dentry, pos,
> + pos + count - 1,
> + SYNC_SUBMIT_DATA | SYNC_WAIT_DATA);
> +}
> +EXPORT_SYMBOL(generic_write_sync);
>
> +/* Flags for generic_sync_file */
> +#define SYNC_INODE 1
> +#define SYNC_SUBMIT_DATA 2
> +#define SYNC_WAIT_DATA 4
When I think about this more I really hate the latter two flags.
There's really no reason to just do only either the submit or wait.
I'd say kill the flags for now and just implement generic_write_sync
as:
int generic_write_sync(struct file *file, loff_t pos, loff_t count)
{
if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host))
return 0;
return vfs_fsync_range(file, file->f_path.dentry, pos,
pos + count - 1, 1);
}
and we can look into replacing the datasync flag with something more
meaningfull later through the whole fsync stack.
--
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