Re: [PATCH v4 015/100] nfsd: clean up reset_union_bmap_deny

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

 



On Thu, 10 Jul 2014 03:31:00 -0700
Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

> >  static void
> > -reset_union_bmap_deny(unsigned long deny, struct nfs4_ol_stateid *stp)
> > +reset_union_bmap_deny(u32 deny, struct nfs4_ol_stateid *stp)
> >  {
> >  	int i;
> > -	for (i = 0; i < 4; i++) {
> > +
> > +	for (i = 1; i < 4; i++) {
> >  		if ((i & deny) != i)
> >  			clear_deny(i, stp);
> >  	}
> 
> 
> Couldn't this simply be written as:
> 
> 	stp->st_deny_bmap &= ~deny;
> 
> and inlined into the caller?

No, the st_deny_bmap does not hold the NFS_SHARE_DENY_* bits
themselves. It sets a bit for each NFS_SHARE_DENY_* mode that the
stateid has used. The difference is subtle, but significant.

The rationale for that is in the comments above bmap_to_share_mode.

-- 
Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
--
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