Commit 216b6cbdcbd86b1db0754d58886b466ae31f5a63
Committed by
J. Bruce Fields
1 parent
6f0c0580b7
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
exportfs: add FILEID_INVALID to indicate invalid fid_type
This commit adds FILEID_INVALID = 0xff in fid_type to indicate invalid fid_type It avoids using magic number 255 Signed-off-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: Vivek Trivedi <vtrivedi018@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Showing 4 changed files with 10 additions and 5 deletions Side-by-side Diff
fs/exportfs/expfs.c
fs/fhandle.c
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | handle_bytes = handle_dwords * sizeof(u32); |
53 | 53 | handle->handle_bytes = handle_bytes; |
54 | 54 | if ((handle->handle_bytes > f_handle.handle_bytes) || |
55 | - (retval == 255) || (retval == -ENOSPC)) { | |
55 | + (retval == FILEID_INVALID) || (retval == -ENOSPC)) { | |
56 | 56 | /* As per old exportfs_encode_fh documentation |
57 | 57 | * we could return ENOSPC to indicate overflow |
58 | 58 | * But file system returned 255 always. So handle |
fs/nfsd/nfsfh.c
... | ... | @@ -572,7 +572,7 @@ |
572 | 572 | |
573 | 573 | if (inode) |
574 | 574 | _fh_update(fhp, exp, dentry); |
575 | - if (fhp->fh_handle.fh_fileid_type == 255) { | |
575 | + if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) { | |
576 | 576 | fh_put(fhp); |
577 | 577 | return nfserr_opnotsupp; |
578 | 578 | } |
... | ... | @@ -603,7 +603,7 @@ |
603 | 603 | goto out; |
604 | 604 | |
605 | 605 | _fh_update(fhp, fhp->fh_export, dentry); |
606 | - if (fhp->fh_handle.fh_fileid_type == 255) | |
606 | + if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) | |
607 | 607 | return nfserr_opnotsupp; |
608 | 608 | } |
609 | 609 | out: |