From patchwork Tue Dec 14 14:57:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 410131 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBEEstSC007667 for ; Tue, 14 Dec 2010 14:58:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758596Ab0LNO56 (ORCPT ); Tue, 14 Dec 2010 09:57:58 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:55072 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758585Ab0LNO5z (ORCPT ); Tue, 14 Dec 2010 09:57:55 -0500 Received: by gyb11 with SMTP id 11so374133gyb.19 for ; Tue, 14 Dec 2010 06:57:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:subject:to:cc :date:message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=vA5/b5gH7KK2o+hhoNVmf6vM476IpcHms7mKUqrsSVc=; b=Ekc+wef4Xz3DF1dge8G4+OStc6hsOfKLWngQoq76s2husg5RAvECQ0UATGIjWQL790 L0L3NG/qUrwXMmN0poDZAiVQ6KFMkBgSP6nMGebF/yC3FBnIjkijcPH4/E2IejHkoKWX AfWe224+tQ9Bj6pQ5c/69q3Of2UeYTvcH2pTc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=hO/uOkNrckdgIq7brSq6t4jNZo460BgIL13/xzg58Ly6biREZ8ThK/5Ft8nh0bH3xQ 4fJqfemyJUVnTStDWjKiHDqEPuB7p37Q4IOR44LMiba/eR4Yzclu5C6rooR27c9QTVJW JME5le5aLMZghYOiHB6foatGY9Y+nunqUmVfg= Received: by 10.42.179.129 with SMTP id bq1mr4388461icb.219.1292338674743; Tue, 14 Dec 2010 06:57:54 -0800 (PST) Received: from matisse.1015granger.net ([99.26.161.222]) by mx.google.com with ESMTPS id u5sm16657ics.6.2010.12.14.06.57.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 06:57:53 -0800 (PST) From: Chuck Lever Subject: [PATCH 21/31] lockd: Move nlmdbg_cookie2a() to svclock.c To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Tue, 14 Dec 2010 09:57:52 -0500 Message-ID: <20101214145752.2293.57312.stgit@matisse.1015granger.net> In-Reply-To: <20101214144747.2293.68070.stgit@matisse.1015granger.net> References: <20101214144747.2293.68070.stgit@matisse.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Dec 2010 14:58:19 +0000 (UTC) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index ef5659b..9266c46 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -46,6 +46,7 @@ static void nlmsvc_remove_block(struct nlm_block *block); static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock); static void nlmsvc_freegrantargs(struct nlm_rqst *call); static const struct rpc_call_ops nlmsvc_grant_ops; +static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie); /* * The list of blocked locks to retry @@ -934,3 +935,32 @@ nlmsvc_retry_blocked(void) return timeout; } + +#ifdef RPC_DEBUG +static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) +{ + /* + * We can get away with a static buffer because we're only + * called with BKL held. + */ + static char buf[2*NLM_MAXCOOKIELEN+1]; + unsigned int i, len = sizeof(buf); + char *p = buf; + + len--; /* allow for trailing \0 */ + if (len < 3) + return "???"; + for (i = 0 ; i < cookie->len ; i++) { + if (len < 2) { + strcpy(p-3, "..."); + break; + } + sprintf(p, "%02x", cookie->data[i]); + p += 2; + len -= 2; + } + *p = '\0'; + + return buf; +} +#endif diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c index 0eb694d..964666c 100644 --- a/fs/lockd/xdr.c +++ b/fs/lockd/xdr.c @@ -341,32 +341,3 @@ nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) { return xdr_ressize_check(rqstp, p); } - -#ifdef RPC_DEBUG -const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) -{ - /* - * We can get away with a static buffer because we're only - * called with BKL held. - */ - static char buf[2*NLM_MAXCOOKIELEN+1]; - unsigned int i, len = sizeof(buf); - char *p = buf; - - len--; /* allow for trailing \0 */ - if (len < 3) - return "???"; - for (i = 0 ; i < cookie->len ; i++) { - if (len < 2) { - strcpy(p-3, "..."); - break; - } - sprintf(p, "%02x", cookie->data[i]); - p += 2; - len -= 2; - } - *p = '\0'; - - return buf; -} -#endif diff --git a/include/linux/lockd/debug.h b/include/linux/lockd/debug.h index 34b2b7f..257d377 100644 --- a/include/linux/lockd/debug.h +++ b/include/linux/lockd/debug.h @@ -44,14 +44,4 @@ #define NLMDBG_XDR 0x0100 #define NLMDBG_ALL 0x7fff - -/* - * Support for printing NLM cookies in dprintk() - */ -#ifdef RPC_DEBUG -struct nlm_cookie; -/* Call this function with the BKL held (it uses a static buffer) */ -extern const char *nlmdbg_cookie2a(const struct nlm_cookie *); -#endif - #endif /* LINUX_LOCKD_DEBUG_H */