Skip to content

Commit c306d73

Browse files
committed
NFSD: Deprecate NFS_OFFSET_MAX
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>
1 parent 6a4d333 commit c306d73

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

fs/nfsd/nfs3xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ svcxdr_encode_entry3_common(struct nfsd3_readdirres *resp, const char *name,
10601060
return false;
10611061
/* cookie */
10621062
resp->cookie_offset = dirlist->len;
1063-
if (xdr_stream_encode_u64(xdr, NFS_OFFSET_MAX) < 0)
1063+
if (xdr_stream_encode_u64(xdr, OFFSET_MAX) < 0)
10641064
return false;
10651065

10661066
return true;

fs/nfsd/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3495,7 +3495,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
34953495
p = xdr_reserve_space(xdr, 3*4 + namlen);
34963496
if (!p)
34973497
goto fail;
3498-
p = xdr_encode_hyper(p, NFS_OFFSET_MAX); /* offset of next entry */
3498+
p = xdr_encode_hyper(p, OFFSET_MAX); /* offset of next entry */
34993499
p = xdr_encode_array(p, name, namlen); /* name length & name */
35003500

35013501
nfserr = nfsd4_encode_dirent_fattr(xdr, cd, name, namlen);

include/linux/nfs.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ static inline void nfs_copy_fh(struct nfs_fh *target, const struct nfs_fh *sourc
3636
memcpy(target->data, source->data, source->size);
3737
}
3838

39-
40-
/*
41-
* This is really a general kernel constant, but since nothing like
42-
* this is defined in the kernel headers, I have to do it here.
43-
*/
44-
#define NFS_OFFSET_MAX ((__s64)((~(__u64)0) >> 1))
45-
46-
4739
enum nfs3_stable_how {
4840
NFS_UNSTABLE = 0,
4941
NFS_DATA_SYNC = 1,

0 commit comments

Comments
 (0)