lkml.org 
[lkml]   [2013]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ext4: cache all of an extent tree's leaf block upon reading
On Thu, Sep 05, 2013 at 10:37:49AM -0400, Dave Jones wrote:
> > +void ext4_es_cache_extent(struct inode *inode, ext4_lblk_t lblk,
> > + ext4_lblk_t len, ext4_fsblk_t pblk,
> > + unsigned int status)
> > +{
> > + struct extent_status *es;
> > + struct extent_status newes;
> > + ext4_lblk_t end = lblk + len - 1;
> > +
> > + newes.es_lblk = lblk;
> > + newes.es_len = len;
> > + ext4_es_store_pblock(&newes, pblk);
>
>
> ext4_es_store_pblock or's the pblk with the existing contents of the struct member.
> (albeit masked with ES_MASK)
>
> Should there be a
>
> newes.es_pblk = 0;
>
> up there too ?

The next line after ext4_es_store_pblock() is:

ext4_es_store_status(&newes, status);

This will set remaining ES_WRITTEN | ES_UNWRITTEN... bits.

So the only reason to add a line explicitly setting es_pblk to zero
would be to suppress a warning from some insufficiently smart static
code analysis tool. I didn't see a warning from gcc, but it's
possible that this is something which is causing Coverity or some
other code scanner heartburn.

Cheers,

- Ted


\
 
 \ /
  Last update: 2013-09-05 17:21    [W:0.939 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site