diff options
| author | Christoph Hellwig <hch@lst.de> | 2016-02-08 21:11:50 +0100 |
|---|---|---|
| committer | Luis Henriques <luis.henriques@canonical.com> | 2016-03-08 12:15:18 +0000 |
| commit | 29e3552e01da712f819d150801e0cada6ce9444e (patch) | |
| tree | cc40a01d2eddef4ad1b8e9205c50eca9b91ab665 /include/linux | |
| parent | 63ce06ed7250367b3f8c8f5a51ce1c1d35b7ca74 (diff) | |
nfs: fix nfs_size_to_loff_t
commit 50ab8ec74a153eb30db26529088bc57dd700b24c upstream.
See http: //www.infradead.org/rpr.html
X-Evolution-Source: 1451162204.2173.11@leira.trondhjem.org
Content-Transfer-Encoding: 8bit
Mime-Version: 1.0
We support OFFSET_MAX just fine, so don't round down below it. Also
switch to using min_t to make the helper more readable.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Fixes: 433c92379d9c ("NFS: Clean up nfs_size_to_loff_t()")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nfs_fs.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index e30f6059ecd6..7faf70d9e869 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -577,9 +577,7 @@ static inline int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, static inline loff_t nfs_size_to_loff_t(__u64 size) { - if (size > (__u64) OFFSET_MAX - 1) - return OFFSET_MAX - 1; - return (loff_t) size; + return min_t(u64, size, OFFSET_MAX); } static inline ino_t |
