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/linux | |
| parent | 8bda4e4c98d14566fc1a354c62fb59d70cc49b97 (diff) | |
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/linux')
| -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 e94971040de9..7deb5b0347f7 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 *, | |||
| 503 | * inline functions | 503 | * inline functions |
| 504 | */ | 504 | */ |
| 505 | 505 | ||
| 506 | static inline loff_t | 506 | static inline loff_t nfs_size_to_loff_t(__u64 size) |
| 507 | nfs_size_to_loff_t(__u64 size) | ||
| 508 | { | 507 | { |
| 509 | loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; | 508 | if (size > (__u64) OFFSET_MAX - 1) |
| 510 | if (size > maxsz) | 509 | return OFFSET_MAX - 1; |
| 511 | return maxsz; | ||
| 512 | return (loff_t) size; | 510 | return (loff_t) size; |
| 513 | } | 511 | } |
| 514 | 512 | ||
