Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2253878ybk; Mon, 11 May 2020 16:18:08 -0700 (PDT) X-Google-Smtp-Source: APiQypIOVRTRW9zdc2M2vJpZzpc+B3XvZcps0htCWXuy3GXJiekVdxaeRqOD0jeKy5RCHHY90b6A X-Received: by 2002:a17:906:49d0:: with SMTP id w16mr15106941ejv.364.1589239088572; Mon, 11 May 2020 16:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589239088; cv=none; d=google.com; s=arc-20160816; b=Scle88DrP1b0YpKSEdubnLA+A0AslwlNWsqbtnqsxRHTHkAkAe+dN+PoTEfvmOBJHR 5PqC62BvaVmq8ra5IUV6DgB52IswJ6Cb3kBMRFyQzLfg6mGsA42nwKShjNVWw3uKRlEv s6J2TpMS1py8wE9NNhNWIfDFjEaoEoP98Ynrz3FrakBXyNw6VmWgugSOZkgFKZtENxit yyZj/gbxOgBs5vq3JZJySxkyBof6PRNCS9EURUTKVN9JSBt2c5cCg5q0wU4/ce6M1ZNn 1GgDi+7s1Nb8/nesnKlktbxWAx1Vn4t//KA+BhdggdRgSE9hB0nqRpBK25V1AEAC7X6d NfwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=UB+Gt4ZBG8B+rWWumMQ5U0QUENrHgtI10R8jO8c0K20=; b=w3Ru2OObdlwlkxU9rycZpdvVzQE4ygIH3Hn/SbZSqdcOox4S2ZcG9VvsV4rtLgUL2K MlcYeQ/QSoqvO7wx2OJMJqGKBKTf1AeMFMYPLzaAmaQtrZ7bwGN2PmeSN8PQaq++Xs5E x3+rE24+/xCY/fOe19z7z0gZblEJPrsGI3fg/yyjTZlKejeGWB4OB/+AcrnVZ8SisZCD tJkrlL6X/fBpsjb1ffDCIeJ8t9eYBzzOg3hjNfiu0hsCUVf6mNY/NWwVWw2pDoBNjgvL LZp/B8TGhMYxANt/ntUJYYsmy1u5hKpcxX6YRHYTtxM+LWTokRVVMN8Yx6rDQvssAQn0 E8uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si3431849ejs.531.2020.05.11.16.17.34; Mon, 11 May 2020 16:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726106AbgEKXRS (ORCPT + 99 others); Mon, 11 May 2020 19:17:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726891AbgEKXRS (ORCPT ); Mon, 11 May 2020 19:17:18 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00::f03c:91ff:fe50:41d6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FF24C061A0C for ; Mon, 11 May 2020 16:17:18 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 617341C21; Mon, 11 May 2020 19:17:17 -0400 (EDT) From: "J. Bruce Fields" To: linux-nfs@vger.kernel.org Cc: "J. Bruce Fields" Subject: [PATCH 1/2] nfsd4: common stateid-printing code Date: Mon, 11 May 2020 19:17:15 -0400 Message-Id: <1589239036-17100-1-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" There's a problem with how I'm formatting stateids. Before I fix it, I'd like to move the stateid formatting into a common helper. Signed-off-by: J. Bruce Fields --- fs/nfsd/nfs4state.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c107caa56525..ded08aeae497 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2422,6 +2422,11 @@ static void nfs4_show_owner(struct seq_file *s, struct nfs4_stateowner *oo) seq_quote_mem(s, oo->so_owner.data, oo->so_owner.len); } +static void nfs4_show_stateid(struct seq_file *s, stateid_t *stid) +{ + seq_printf(s, "0x%16phN", stid); +} + static int nfs4_show_open(struct seq_file *s, struct nfs4_stid *st) { struct nfs4_ol_stateid *ols; @@ -2437,7 +2442,9 @@ static int nfs4_show_open(struct seq_file *s, struct nfs4_stid *st) nf = st->sc_file; file = find_any_file(nf); - seq_printf(s, "- 0x%16phN: { type: open, ", &st->sc_stateid); + seq_printf(s, "- "); + nfs4_show_stateid(s, &st->sc_stateid); + seq_printf(s, ": { type: open, "); access = bmap_to_share_mode(ols->st_access_bmap); deny = bmap_to_share_mode(ols->st_deny_bmap); @@ -2470,7 +2477,9 @@ static int nfs4_show_lock(struct seq_file *s, struct nfs4_stid *st) nf = st->sc_file; file = find_any_file(nf); - seq_printf(s, "- 0x%16phN: { type: lock, ", &st->sc_stateid); + seq_printf(s, "- "); + nfs4_show_stateid(s, &st->sc_stateid); + seq_printf(s, ": { type: lock, "); /* * Note: a lock stateid isn't really the same thing as a lock, @@ -2499,7 +2508,9 @@ static int nfs4_show_deleg(struct seq_file *s, struct nfs4_stid *st) nf = st->sc_file; file = nf->fi_deleg_file; - seq_printf(s, "- 0x%16phN: { type: deleg, ", &st->sc_stateid); + seq_printf(s, "- "); + nfs4_show_stateid(s, &st->sc_stateid); + seq_printf(s, ": { type: deleg, "); /* Kinda dead code as long as we only support read delegs: */ seq_printf(s, "access: %s, ", @@ -2521,7 +2532,9 @@ static int nfs4_show_layout(struct seq_file *s, struct nfs4_stid *st) ls = container_of(st, struct nfs4_layout_stateid, ls_stid); file = ls->ls_file; - seq_printf(s, "- 0x%16phN: { type: layout, ", &st->sc_stateid); + seq_printf(s, "- "); + nfs4_show_stateid(s, &st->sc_stateid); + seq_printf(s, ": { type: layout, "); /* XXX: What else would be useful? */ -- 2.26.2