nfsd: Remove macro LOFF_OVERFLOW
authorKinglong Mee <kinglongmee@gmail.com>
Mon, 13 Jul 2015 09:34:19 +0000 (17:34 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 10 Aug 2015 20:05:52 +0000 (16:05 -0400)
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index 433355d467946e020f7617f3955479cfb125a288..74eb8c2e13a015beb5d2c25d2f2c2403d7d49194 100644 (file)
@@ -5045,9 +5045,6 @@ out:
        return status;
 }
 
-
-#define LOFF_OVERFLOW(start, len)      ((u64)(len) > ~(u64)(start))
-
 static inline u64
 end_offset(u64 start, u64 len)
 {
@@ -5299,8 +5296,8 @@ find_or_create_lock_stateid(struct nfs4_lockowner *lo, struct nfs4_file *fi,
 static int
 check_lock_length(u64 offset, u64 length)
 {
-       return ((length == 0)  || ((length != NFS4_MAX_UINT64) &&
-            LOFF_OVERFLOW(offset, length)));
+       return ((length == 0) || ((length != NFS4_MAX_UINT64) &&
+               (length > ~offset)));
 }
 
 static void get_lock_access(struct nfs4_ol_stateid *lock_stp, u32 access)