]> git.ipfire.org Git - people/ms/linux.git/blobdiff - fs/lockd/xdr4.c
Merge branch 'for-6.0/dax' into libnvdimm-fixes
[people/ms/linux.git] / fs / lockd / xdr4.c
index 856267c0864bdef39fbf63963864ebf5f33f89f7..712fdfeb8ef063bd1ad12f80c3c2ddf30f75101e 100644 (file)
 
 #include "svcxdr.h"
 
-static inline loff_t
-s64_to_loff_t(__s64 offset)
-{
-       return (loff_t)offset;
-}
-
-
 static inline s64
 loff_t_to_s64(loff_t offset)
 {
@@ -70,8 +63,6 @@ static bool
 svcxdr_decode_lock(struct xdr_stream *xdr, struct nlm_lock *lock)
 {
        struct file_lock *fl = &lock->fl;
-       u64 len, start;
-       s64 end;
 
        if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len))
                return false;
@@ -81,20 +72,14 @@ svcxdr_decode_lock(struct xdr_stream *xdr, struct nlm_lock *lock)
                return false;
        if (xdr_stream_decode_u32(xdr, &lock->svid) < 0)
                return false;
-       if (xdr_stream_decode_u64(xdr, &start) < 0)
+       if (xdr_stream_decode_u64(xdr, &lock->lock_start) < 0)
                return false;
-       if (xdr_stream_decode_u64(xdr, &len) < 0)
+       if (xdr_stream_decode_u64(xdr, &lock->lock_len) < 0)
                return false;
 
        locks_init_lock(fl);
        fl->fl_flags = FL_POSIX;
        fl->fl_type  = F_RDLCK;
-       end = start + len - 1;
-       fl->fl_start = s64_to_loff_t(start);
-       if (len == 0 || end < 0)
-               fl->fl_end = OFFSET_MAX;
-       else
-               fl->fl_end = s64_to_loff_t(end);
 
        return true;
 }