aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/nfs_fs.h')
-rw-r--r--include/linux/nfs_fs.h8
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
506static inline loff_t 506static inline loff_t nfs_size_to_loff_t(__u64 size)
507nfs_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