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

lockd: Move nlmdbg_cookie2a() to svclock.c

Clean up. nlmdbg_cookie2a() is used only in svclock.c.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

authored by

Chuck Lever and committed by
Trond Myklebust
d8367c50 7d93bd71

+30 -39
+30
fs/lockd/svclock.c
··· 46 46 static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock); 47 47 static void nlmsvc_freegrantargs(struct nlm_rqst *call); 48 48 static const struct rpc_call_ops nlmsvc_grant_ops; 49 + static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie); 49 50 50 51 /* 51 52 * The list of blocked locks to retry ··· 935 934 936 935 return timeout; 937 936 } 937 + 938 + #ifdef RPC_DEBUG 939 + static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) 940 + { 941 + /* 942 + * We can get away with a static buffer because we're only 943 + * called with BKL held. 944 + */ 945 + static char buf[2*NLM_MAXCOOKIELEN+1]; 946 + unsigned int i, len = sizeof(buf); 947 + char *p = buf; 948 + 949 + len--; /* allow for trailing \0 */ 950 + if (len < 3) 951 + return "???"; 952 + for (i = 0 ; i < cookie->len ; i++) { 953 + if (len < 2) { 954 + strcpy(p-3, "..."); 955 + break; 956 + } 957 + sprintf(p, "%02x", cookie->data[i]); 958 + p += 2; 959 + len -= 2; 960 + } 961 + *p = '\0'; 962 + 963 + return buf; 964 + } 965 + #endif
-29
fs/lockd/xdr.c
··· 341 341 { 342 342 return xdr_ressize_check(rqstp, p); 343 343 } 344 - 345 - #ifdef RPC_DEBUG 346 - const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) 347 - { 348 - /* 349 - * We can get away with a static buffer because we're only 350 - * called with BKL held. 351 - */ 352 - static char buf[2*NLM_MAXCOOKIELEN+1]; 353 - unsigned int i, len = sizeof(buf); 354 - char *p = buf; 355 - 356 - len--; /* allow for trailing \0 */ 357 - if (len < 3) 358 - return "???"; 359 - for (i = 0 ; i < cookie->len ; i++) { 360 - if (len < 2) { 361 - strcpy(p-3, "..."); 362 - break; 363 - } 364 - sprintf(p, "%02x", cookie->data[i]); 365 - p += 2; 366 - len -= 2; 367 - } 368 - *p = '\0'; 369 - 370 - return buf; 371 - } 372 - #endif
-10
include/linux/lockd/debug.h
··· 44 44 #define NLMDBG_XDR 0x0100 45 45 #define NLMDBG_ALL 0x7fff 46 46 47 - 48 - /* 49 - * Support for printing NLM cookies in dprintk() 50 - */ 51 - #ifdef RPC_DEBUG 52 - struct nlm_cookie; 53 - /* Call this function with the BKL held (it uses a static buffer) */ 54 - extern const char *nlmdbg_cookie2a(const struct nlm_cookie *); 55 - #endif 56 - 57 47 #endif /* LINUX_LOCKD_DEBUG_H */