Skip to content

Commit

Permalink
NFSD: Deprecate NFS_OFFSET_MAX
Browse files Browse the repository at this point in the history
NFS_OFFSET_MAX was introduced way back in Linux v2.3.y before there
was a kernel-wide OFFSET_MAX value. As a clean up, replace the last
few uses of it with its generic equivalent, and get rid of it.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
chucklever committed Feb 9, 2022
1 parent 6a4d333 commit c306d73
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs3xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ svcxdr_encode_entry3_common(struct nfsd3_readdirres *resp, const char *name,
return false;
/* cookie */
resp->cookie_offset = dirlist->len;
if (xdr_stream_encode_u64(xdr, NFS_OFFSET_MAX) < 0)
if (xdr_stream_encode_u64(xdr, OFFSET_MAX) < 0)
return false;

return true;
Expand Down
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3495,7 +3495,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
p = xdr_reserve_space(xdr, 3*4 + namlen);
if (!p)
goto fail;
p = xdr_encode_hyper(p, NFS_OFFSET_MAX); /* offset of next entry */
p = xdr_encode_hyper(p, OFFSET_MAX); /* offset of next entry */
p = xdr_encode_array(p, name, namlen); /* name length & name */

nfserr = nfsd4_encode_dirent_fattr(xdr, cd, name, namlen);
Expand Down
8 changes: 0 additions & 8 deletions include/linux/nfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ static inline void nfs_copy_fh(struct nfs_fh *target, const struct nfs_fh *sourc
memcpy(target->data, source->data, source->size);
}


/*
* This is really a general kernel constant, but since nothing like
* this is defined in the kernel headers, I have to do it here.
*/
#define NFS_OFFSET_MAX ((__s64)((~(__u64)0) >> 1))


enum nfs3_stable_how {
NFS_UNSTABLE = 0,
NFS_DATA_SYNC = 1,
Expand Down

0 comments on commit c306d73

Please sign in to comment.