diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-07-01 12:12:14 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-10 23:40:43 -0400 |
commit | 433c92379d9c2c59c2ebc7628fe4fb02cfc2daf8 (patch) | |
tree | 6c67e6a8308857afdace8e767e7a583b02ede500 /include | |
parent | 8bda4e4c98d14566fc1a354c62fb59d70cc49b97 (diff) | |
download | op-kernel-dev-433c92379d9c2c59c2ebc7628fe4fb02cfc2daf8.zip op-kernel-dev-433c92379d9c2c59c2ebc7628fe4fb02cfc2daf8.tar.gz |
NFS: Clean up nfs_size_to_loff_t()
Use the same file size limit that lockd uses.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfs_fs.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index e949710..7deb5b0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -503,12 +503,10 @@ extern int nfsroot_mount(struct sockaddr_in *, char *, struct nfs_fh *, * inline functions */ -static inline loff_t -nfs_size_to_loff_t(__u64 size) +static inline loff_t nfs_size_to_loff_t(__u64 size) { - loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; - if (size > maxsz) - return maxsz; + if (size > (__u64) OFFSET_MAX - 1) + return OFFSET_MAX - 1; return (loff_t) size; } |