From patchwork Wed Nov 17 18:00:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 333721 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 oAHI0LcE032629 for ; Wed, 17 Nov 2010 18:00:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935165Ab0KQSA3 (ORCPT ); Wed, 17 Nov 2010 13:00:29 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:52633 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933795Ab0KQSA2 (ORCPT ); Wed, 17 Nov 2010 13:00:28 -0500 Received: by mail-iw0-f174.google.com with SMTP id 35so2387538iwn.19 for ; Wed, 17 Nov 2010 10:00:28 -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=gDmQFoTWA1yZcNXTQ2wXU0XvYcRLjioOVZNtddlMj/s=; b=J+tabbEQRNv4Nrl1itVeGMmBEn8zcEv7mZpM3n6S72CDOu6DUOVC5sHI6cdbFeOZ1/ Xi55S4lLVGDrL55jfFAmsfIsIsjgBxiwRtjC5OSy4M8YoIqpIdaF2FeS3MMxJC7WsthA TuH5Fb5f0BPm5SOssGi5YFAIHSxs0paRsAzTM= 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=ectjA52QZm2NIDRRidInMYUlRIGzjiQUgWiiXHUA0QjYfd4ot4AFF0dOed2hh67RFK KvZHub8DqBFSOGUKqHz2Dah09ZdclGp58VgqirEmNmxAzVBr2ZW8pjINOmUgv66mrqxc 25RdpC/DWXrTVXdGsKHzh1z0V8vU1YztX6hsw= Received: by 10.231.33.203 with SMTP id i11mr6945017ibd.8.1290016827130; Wed, 17 Nov 2010 10:00:27 -0800 (PST) Received: from matisse.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net [99.26.161.222]) by mx.google.com with ESMTPS id i16sm2433480ibl.18.2010.11.17.10.00.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Nov 2010 10:00:26 -0800 (PST) From: Chuck Lever Subject: [PATCH 04/12] lockd: Move nlmdbg_cookie2a() to svclock.c To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Wed, 17 Nov 2010 13:00:24 -0500 Message-ID: <20101117180024.29429.94497.stgit@matisse.1015granger.net> In-Reply-To: <20101117175317.29429.90956.stgit@matisse.1015granger.net> References: <20101117175317.29429.90956.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]); Wed, 17 Nov 2010 18:00:29 +0000 (UTC) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index c462d34..8e3b5f1 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -47,6 +47,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 @@ -935,3 +936,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 */