Re: [PATCH 06/12] sunrpc/cache: avoid variable over-loading in cache_defer_req

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

 



On Tuesday August 4, bfields@xxxxxxxxxxxx wrote:
> On Tue, Aug 04, 2009 at 03:22:39PM +1000, NeilBrown wrote:
> > In cache_defer_req, 'dreq' is used for two significantly different
> > values that happen to be of the same type.
> > 
> > This is both confusing, and make it hard to extend the range of one of
> > the values as we will in the next patch.
> > So introduce 'discard' to take one of the values.
> > 
> > Signed-off-by: NeilBrown <neilb@xxxxxxx>
...
> > @@ -586,20 +586,20 @@ static int cache_defer_req(struct cache_req *req, struct cache_head *item)
> >  	list_add(&dreq->hash, &cache_defer_hash[hash]);
> >  
> >  	/* it is in, now maybe clean up */
> > -	dreq = NULL;
> > +	discard = NULL;
> >  	if (++cache_defer_cnt > DFR_MAX) {
> > -		dreq = list_entry(cache_defer_list.prev,
> > -				  struct cache_deferred_req, recent);
> > +		discard = list_entry(cache_defer_list.prev,
> > +				     struct cache_deferred_req, recent);
> >  		list_del_init(&dreq->recent);
> >  		list_del_init(&dreq->hash);
> 
> Shouldn't these two "dreq"'s be "discard"'s as well?

Yes, definitely.  Thanks for catching that.

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

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux