linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Chris Mason <mason@suse.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] add -o flush for fat
Date: Fri, 4 Aug 2006 18:31:49 -0700	[thread overview]
Message-ID: <20060804183149.954b0e59.akpm@osdl.org> (raw)
In-Reply-To: <20060804192721.GF1048@watt.suse.com>

On Fri, 4 Aug 2006 15:27:21 -0400
Chris Mason <mason@suse.com> wrote:

>  /*
> + * starts IO on any dirty blocks in the block device.  This uses
> + * filemap_flush, and so it does not wait for the io to finish, and does
> + * not wait on any IO currently in flight.
> + */
> +void writeback_bdev(struct super_block *sb)
> +{
> +	struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping;
> +	filemap_flush(mapping);
> +}
> +EXPORT_SYMBOL_GPL(writeback_bdev);
> +
> +/*
> + * start writeback on both the inode and the data blocks.
> + * filemap_fdatawrite is used, so it waits for any IO that was in
> + * flight for dirty blocks at the start of this call.  This will not
> + * wait for any IO it starts.
> + */
> +void writeback_inode(struct inode *inode)
> +{
> +
> +	struct address_space *mapping = inode->i_mapping;
> +	struct writeback_control wbc = {
> +		.sync_mode = WB_SYNC_NONE,
> +		.nr_to_write = 0,
> +	};
> +	/* if we used WB_SYNC_ALL, sync_inode waits for the io for the
> +	 * inode to finish.  So WB_SYNC_NONE is sent down to sync_inode
> +	 * and filemap_fdatawrite is used for the data blocks
> +	 */
> +	sync_inode(inode, &wbc);
> +	filemap_fdatawrite(mapping);
> +}
> +EXPORT_SYMBOL_GPL(writeback_inode);

Could we have more detail on what you're trying to do here?

You've obviously made some decisions about how to handle under-writeback
data, dirty data, integrity versus cleaning, etc.  What were those
decisions and what led you to them?

We should document the precise semantics of these two functions, especially
wrt data integrity, handling of dirty-but-under-writeback pages, etc. 
(Right now I'm not sure what those semantics are).

I'm also wondering what sync_inode(nr_to_write=0) does ;) I think it writes
one page...



  reply	other threads:[~2006-08-05  1:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04 19:27 [PATCH] add -o flush for fat Chris Mason
2006-08-05  1:31 ` Andrew Morton [this message]
2006-08-05 12:26   ` Chris Mason
2006-08-05 19:12     ` Andrew Morton
2006-08-05 20:54       ` OGAWA Hirofumi
2006-08-07 20:23       ` Chris Mason
2006-08-07 23:58         ` Andrew Morton
2006-08-08  8:05           ` Chris Mason

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=20060804183149.954b0e59.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mason@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).