]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
NFS: Clean up nfs_size_to_loff_t()
authorChuck Lever <chuck.lever@oracle.com>
Sun, 1 Jul 2007 16:12:14 +0000 (12:12 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 11 Jul 2007 03:40:43 +0000 (23:40 -0400)
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>
include/linux/nfs_fs.h

index e94971040de9028272c225ddb96508426663dd4e..7deb5b0347f7483a41e2f9eac4a0278a4d65a391 100644 (file)
@@ -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;
 }