[PATCH] fix enc_stateid_sz for nfsd callbacks

Trond Myklebust trond.myklebust at fys.uio.no
Tue May 29 16:37:55 EDT 2007


On Tue, 2007-05-29 at 16:28 -0400, J. Bruce Fields wrote:
> On Tue, May 29, 2007 at 06:48:51PM +0300, Benny Halevy wrote:
> > Trond Myklebust wrote:
> > > On Tue, 2007-05-29 at 18:37 +0300, Benny Halevy wrote:
> > >> enc_stateid_sz should be given in u32 words units, not bytes.
> > >> Applies to the pnfs git tree (master and 4.1-sessions) as well as to mainline
> > >>
> > >> Signed-off-by: Benny Halevy <bhalevy at panasas.com>
> > >> ---
> > >>  fs/nfsd/nfs4callback.c |    2 +-
> > >>  1 files changed, 1 insertions(+), 1 deletions(-)
> > >>
> > >> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> > >> index 97631bf..5a0d983 100644
> > >> --- a/fs/nfsd/nfs4callback.c
> > >> +++ b/fs/nfsd/nfs4callback.c
> > >> @@ -82,7 +82,7 @@ enum nfs_cb_opnum4 {
> > >>  #define op_enc_sz			1
> > >>  #define op_dec_sz			2
> > >>  #define enc_nfs4_fh_sz			(1 + (NFS4_FHSIZE >> 2))
> > >> -#define enc_stateid_sz			16
> > >> +#define enc_stateid_sz			(16 >> 2)
> > > 					  (NFS4_STATEID_SIZE >> 2)
> > > 
> > > instead of the naked value '16' would be better
> > 
> > Do you mean that it's better to use '4' rather than (16 >> 2)?
> 
> He's just suggesting adding a
> 
> #define NFS4_STATEID_SIZE 16
> 
> and using that.  There's probably one or two other places it could be
> used.  I don't really care--it's already obvious we're talking about the
> stateid size here, so the define wouldn't add any documentation.

Look again. I'm stating that one already exists (in
include/linux/nfs4.h) and that it would be better to use that for the
mainline patch.

Trond



More information about the NFSv4 mailing list