From: "Amit K. Arora" <aarora@linux.vnet.ibm.com>
To: Mingming Cao <cmm@us.ibm.com>
Cc: linux-ext4@vger.kernel.org, suparna@in.ibm.com, suzuki@in.ibm.com
Subject: Re: [RFC][Patch 1/1] Persistent preallocation in ext4
Date: Tue, 12 Dec 2006 11:53:02 +0530 [thread overview]
Message-ID: <20061212062302.GA8280@amitarora.in.ibm.com> (raw)
In-Reply-To: <1165886895.3939.18.camel@dyn9047017103.beaverton.ibm.com>
Hi Mingming,
On Mon, Dec 11, 2006 at 05:28:15PM -0800, Mingming Cao wrote:
> On Wed, 2006-12-06 at 11:28 +0530, Amit K. Arora wrote:
>
> > @@ -1142,13 +1155,22 @@
> > /* try to insert block into found extent and return */
> > if (ex && ext4_can_extents_be_merged(inode, ex, newext)) {
> > ext_debug("append %d block to %d:%d (from %llu)\n",
> > - le16_to_cpu(newext->ee_len),
> > + ext4_ext_get_actual_len(newext),
> > le32_to_cpu(ex->ee_block),
> > - le16_to_cpu(ex->ee_len), ext_pblock(ex));
> > + ext4_ext_get_actual_len(ex), ext_pblock(ex));
> > if ((err = ext4_ext_get_access(handle, inode, path + depth)))
> > return err;
> > - ex->ee_len = cpu_to_le16(le16_to_cpu(ex->ee_len)
> > - + le16_to_cpu(newext->ee_len));
> > +
> > + /* ext4_can_extents_be_merged should have checked that either
> > + * both extents are uninitialized, or both aren't. Thus we
> > + * need to check any of them here.
> > + */
> > + if (ext4_ext_is_uninitialized(ex))
> > + uninitialized = 1;
> > + ex->ee_len = cpu_to_le16(ext4_ext_get_actual_len(ex)
> > + + ext4_ext_get_actual_len(newext));
Above line will "remove" the uninitialized bit from "ex", if it was set.
We call ext4_ext_get_actual_len() to get the "actual" lengths of the two
extents, which removes this MSB in ee_len (MSB in ee_len is used to mark
an extent uninitialized). Now, we do this because if lengths of two
uninitialized extents will be added as it is (i.e. without masking out
the MSB in the length), it will result in removing the MSB in ee_len.
For example, 0x8002 + 0x8003 => 0x10005 => 0x5 (since ee_len is 16 bit).
That is why just before this line, we save the "state" of this extent,
whether it was uninitialized or not. And, we restore this "state" below.
> > + if(uninitialized)
> > + ext4_mark_uninitialized_ext(ex);
> > eh = path[depth].p_hdr;
> > nearex = ex;
> > goto merge;
>
> Hmm, I missed the point to re-mark an uninitialized extent here. If ex
> is an uninitialized extent, the mark(the first bit the ee_len) shall
> still there after the update, isn't? We already make sure that two
> large uninitialized extent can't get merged if the resulting length will
> take the first bit, which used as the mark of uninitialized extent.
Please get back if you do not agree with the explanation above and if I
am missing something here. Thanks!
Regards,
Amit Arora
next prev parent reply other threads:[~2006-12-12 6:23 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-05 13:43 [RFC][Patch 1/1] Persistent preallocation in ext4 Amit K. Arora
2006-12-06 5:58 ` Amit K. Arora
2006-12-12 1:28 ` Mingming Cao
2006-12-12 6:23 ` Amit K. Arora [this message]
2006-12-13 0:20 ` Mingming Cao
2006-12-13 10:01 ` Amit K. Arora
2006-12-13 13:36 ` Dave Kleikamp
2006-12-13 15:38 ` Suparna Bhattacharya
2006-12-13 15:54 ` Mingming Cao
2006-12-15 12:35 ` [RFC][Patch 1/2] " Amit K. Arora
2006-12-19 11:05 ` Amit K. Arora
[not found] ` <20061219211206.GO5937@schatzie.adilger.int>
2006-12-20 6:28 ` Amit K. Arora
2006-12-27 23:30 ` Mingming Cao
2007-01-02 11:04 ` Amit K. Arora
2007-01-02 22:47 ` Mingming Cao
2007-01-09 9:05 ` Amit K. Arora
2006-12-15 12:39 ` [RFC][Patch 2/2] " Amit K. Arora
2006-12-15 23:02 ` Andreas Dilger
2006-12-16 4:30 ` Amit K. Arora
2006-12-19 11:42 ` Amit K. Arora
2006-12-19 11:54 ` Amit K. Arora
2006-12-19 21:14 ` Andreas Dilger
2006-12-19 21:23 ` Eric Sandeen
2006-12-20 8:19 ` Amit K. Arora
2006-12-22 15:16 ` Amit K. Arora
2006-12-22 15:31 ` Alex Tomas
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=20061212062302.GA8280@amitarora.in.ibm.com \
--to=aarora@linux.vnet.ibm.com \
--cc=cmm@us.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=suparna@in.ibm.com \
--cc=suzuki@in.ibm.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).