All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org, Zheng Liu <wenqing.lz@taobao.com>,
	Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH 4/9 v4] ext4: adjust interfaces of extent status tree
Date: Fri, 1 Feb 2013 10:51:20 +0800	[thread overview]
Message-ID: <20130201025120.GA10176@gmail.com> (raw)
In-Reply-To: <20130131160206.GD4612@quack.suse.cz>

On Thu, Jan 31, 2013 at 05:02:06PM +0100, Jan Kara wrote:
[snip]
> > @@ -465,6 +490,9 @@ static int __es_remove_extent(struct ext4_es_tree *tree, ext4_lblk_t lblk,
> >  
> >  			newes.es_lblk = end + 1;
> >  			newes.es_len = len2;
> > +			newes.es_pblk = ext4_es_get_pblock(&orig_es,
> > +				orig_es.es_pblk + orig_es.es_len - len2);
> > +			newes.es_status = orig_es.es_status;
> >  			err = __es_insert_extent(tree, &newes);
> >  			if (err) {
> >  				es->es_lblk = orig_es.es_lblk;
> > @@ -474,6 +502,8 @@ static int __es_remove_extent(struct ext4_es_tree *tree, ext4_lblk_t lblk,
> >  		} else {
> >  			es->es_lblk = end + 1;
> >  			es->es_len = len2;
> > +			es->es_pblk = ext4_es_get_pblock(es,
> > +				orig_es.es_pblk + orig_es.es_len - len2);
> >  		}
> >  		goto out;
> >  	}
> > @@ -498,9 +528,13 @@ static int __es_remove_extent(struct ext4_es_tree *tree, ext4_lblk_t lblk,
> >  	}
> >  
> >  	if (es && es->es_lblk < end + 1) {
> > +		ext4_lblk_t orig_len = es->es_len;
> > +
> >  		len1 = ext4_es_end(es) - end;
> >  		es->es_lblk = end + 1;
> >  		es->es_len = len1;
> > +		es->es_pblk = ext4_es_get_pblock(es,
> > +						 es->es_pblk + orig_len - len1);
> >  	}
> >  
> >  out:
>   So ext4_es_get_pblock() seems a bit confusing. I understand that for
> delayed extents physical block doesn't make sence and that you wanted to
> save some typing by that function but IMHO it's making the code less
> readable. I'd rather see there e.g.:
>   if (!ext4_es_is_delayed(es))
> 	es->es_pblk += orig_len - len1;
> and for delayed extents we can just leave es_pblk undefined because nobody
> should really look at it anyway.

Agree.  It will be fixed in next version.

Thanks,
                                                - Zheng

  reply	other threads:[~2013-02-01  2:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31  5:17 [PATCH 0/9 v4] ext4: extent status tree (step2) Zheng Liu
2013-01-31  5:17 ` [PATCH 1/9 v4] ext4: refine extent status tree Zheng Liu
2013-01-31  5:17 ` [PATCH 2/9 v4] ext4: remove EXT4_MAP_FROM_CLUSTER flag Zheng Liu
2013-01-31  5:17 ` [PATCH 3/9 v4] ext4: add physical block and status member into extent status tree Zheng Liu
2013-01-31  5:17 ` [PATCH 4/9 v4] ext4: adjust interfaces of " Zheng Liu
2013-01-31 16:02   ` Jan Kara
2013-02-01  2:51     ` Zheng Liu [this message]
2013-01-31  5:17 ` [PATCH 5/9 v4] ext4: track all extent status in " Zheng Liu
2013-01-31 16:50   ` Jan Kara
2013-02-01  5:33     ` Zheng Liu
2013-02-04 11:27       ` Jan Kara
2013-02-05  3:32         ` Zheng Liu
2013-02-05 12:08           ` Jan Kara
2013-02-05 13:24             ` Zheng Liu
2013-02-05 13:27               ` Jan Kara
2013-01-31  5:17 ` [PATCH 6/9 v4] ext4: lookup block mapping " Zheng Liu
2013-01-31  5:17 ` [PATCH 7/9 v4] ext4: remove single extent cache Zheng Liu
2013-01-31 17:05   ` Jan Kara
2013-02-01  3:08     ` Zheng Liu
2013-01-31  5:17 ` [PATCH 8/9 v4] ext4: adjust some functions for reclaiming extents from extent status tree Zheng Liu
2013-01-31  5:17 ` [PATCH 9/9 v4] ext4: reclaim " Zheng Liu

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=20130201025120.GA10176@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wenqing.lz@taobao.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 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.