Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lockd: Add LOCKD_SHARE_SVID constant for DOS sharing mode

Replace the magic value ~(u32)0 with a named constant. This value
is used as a synthetic svid when looking up lockowners for DOS
share operations, which have no real process ID associated with
them.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+7 -3
+3
fs/lockd/share.h
··· 8 8 #ifndef _LOCKD_SHARE_H 9 9 #define _LOCKD_SHARE_H 10 10 11 + /* Synthetic svid for lockowner lookup during share operations */ 12 + #define LOCKD_SHARE_SVID (~(u32)0) 13 + 11 14 /* 12 15 * DOS share for a specific file 13 16 */
+2 -2
fs/lockd/svc4proc.c
··· 985 985 struct nlm4_lock xdr_lock = { 986 986 .fh = argp->xdrgen.share.fh, 987 987 .oh = argp->xdrgen.share.oh, 988 - .svid = ~(u32)0, 988 + .svid = LOCKD_SHARE_SVID, 989 989 }; 990 990 991 991 resp->xdrgen.cookie = argp->xdrgen.cookie; ··· 1051 1051 struct nlm4_lock xdr_lock = { 1052 1052 .fh = argp->xdrgen.share.fh, 1053 1053 .oh = argp->xdrgen.share.oh, 1054 - .svid = ~(u32)0, 1054 + .svid = LOCKD_SHARE_SVID, 1055 1055 }; 1056 1056 struct nlm_host *host = NULL; 1057 1057 struct nlm_file *file = NULL;
+2 -1
fs/lockd/xdr.c
··· 19 19 #include <uapi/linux/nfs2.h> 20 20 21 21 #include "lockd.h" 22 + #include "share.h" 22 23 #include "svcxdr.h" 23 24 24 25 static inline loff_t ··· 275 274 276 275 memset(lock, 0, sizeof(*lock)); 277 276 locks_init_lock(&lock->fl); 278 - lock->svid = ~(u32)0; 277 + lock->svid = LOCKD_SHARE_SVID; 279 278 280 279 if (!svcxdr_decode_cookie(xdr, &argp->cookie)) 281 280 return false;