提交 433c9237 编写于 作者: C Chuck Lever 提交者: Trond Myklebust

NFS: Clean up nfs_size_to_loff_t()

Use the same file size limit that lockd uses.
Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 8bda4e4c
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册