mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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>
This commit is contained in:
parent
8bda4e4c98
commit
433c92379d
@ -503,12 +503,10 @@ extern int nfsroot_mount(struct sockaddr_in *, char *, struct nfs_fh *,
|
|||||||
* inline functions
|
* inline functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline loff_t
|
static inline loff_t nfs_size_to_loff_t(__u64 size)
|
||||||
nfs_size_to_loff_t(__u64 size)
|
|
||||||
{
|
{
|
||||||
loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1;
|
if (size > (__u64) OFFSET_MAX - 1)
|
||||||
if (size > maxsz)
|
return OFFSET_MAX - 1;
|
||||||
return maxsz;
|
|
||||||
return (loff_t) size;
|
return (loff_t) size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user