Re: [PATCH 4/9 v4] ext4: adjust interfaces of extent status tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux