All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: A question on block_prepare_write()
Date: Sun, 24 Oct 2010 03:00:46 +0900	[thread overview]
Message-ID: <1287856846.1681.58.camel@leonhard> (raw)
In-Reply-To: <20101023104036.2bec05a0.akpm@linux-foundation.org>

2010-10-23 (토), 10:40 -0700, Andrew Morton:
> On Sat, 23 Oct 2010 22:44:42 +0900 Namhyung Kim <namhyung@gmail.com> wrote:
> 
> > Hello,
> > 
> > I see block_prepare_write() has local variable wait[2] to keep track of
> > buffer_heads which are not up-to-date. But I'm wondering how it could be
> > guaranteed there will be no more than 2 such buffer_heads? Is there any
> > restriction on the usage of the function? Using MAX_BUF_PER_PAGE instead
> > of the magic number 2 is just useless? I couldn't find any comments or
> > documentation on this.
> > 
> > Any of your comments would be greatly appreciated. TIA. :-)
> > 
> 
> block_prepare_write() may need to preread any buffer_head which are
> being only partially modified by the write().
> 
> Buffers which aren't being modified at all don't need to be preread. 
> Buffers which are being fully modified don't need to be preread
> (because all their data is being overwritten).
> 
> page:                      |-----------------------|
> buffer_heads:              |-----|-----|-----|-----|
> area we're writing to:               |---------|
> 
> There can only be a maximum of two partially-modified buffers in the page.

I see. It considers both edges of the to-be-written data. Thanks for
your clear and kindly explanation. :-)


-- 
Regards,
Namhyung Kim



WARNING: multiple messages have this Message-ID (diff)
From: Namhyung Kim <namhyung@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: A question on block_prepare_write()
Date: Sun, 24 Oct 2010 03:00:46 +0900	[thread overview]
Message-ID: <1287856846.1681.58.camel@leonhard> (raw)
In-Reply-To: <20101023104036.2bec05a0.akpm@linux-foundation.org>

2010-10-23 (토), 10:40 -0700, Andrew Morton:
> On Sat, 23 Oct 2010 22:44:42 +0900 Namhyung Kim <namhyung@gmail.com> wrote:
> 
> > Hello,
> > 
> > I see block_prepare_write() has local variable wait[2] to keep track of
> > buffer_heads which are not up-to-date. But I'm wondering how it could be
> > guaranteed there will be no more than 2 such buffer_heads? Is there any
> > restriction on the usage of the function? Using MAX_BUF_PER_PAGE instead
> > of the magic number 2 is just useless? I couldn't find any comments or
> > documentation on this.
> > 
> > Any of your comments would be greatly appreciated. TIA. :-)
> > 
> 
> block_prepare_write() may need to preread any buffer_head which are
> being only partially modified by the write().
> 
> Buffers which aren't being modified at all don't need to be preread. 
> Buffers which are being fully modified don't need to be preread
> (because all their data is being overwritten).
> 
> page:                      |-----------------------|
> buffer_heads:              |-----|-----|-----|-----|
> area we're writing to:               |---------|
> 
> There can only be a maximum of two partially-modified buffers in the page.

I see. It considers both edges of the to-be-written data. Thanks for
your clear and kindly explanation. :-)


-- 
Regards,
Namhyung Kim


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-10-23 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-23 13:44 A question on block_prepare_write() Namhyung Kim
2010-10-23 17:40 ` Andrew Morton
2010-10-23 18:00   ` Namhyung Kim [this message]
2010-10-23 18:00     ` Namhyung Kim

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=1287856846.1681.58.camel@leonhard \
    --to=namhyung@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.