Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2208423ybz; Thu, 23 Apr 2020 13:37:22 -0700 (PDT) X-Google-Smtp-Source: APiQypJEphMQp+dcTGIUzivRP/MxC+R8Gd6j0xk1vi+JIsr/0wjpjl09eUfdQnDQCakWkamQPEeg X-Received: by 2002:a17:906:5918:: with SMTP id h24mr4399581ejq.210.1587674242146; Thu, 23 Apr 2020 13:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587674242; cv=none; d=google.com; s=arc-20160816; b=Ef76aBHAtHXoBM2N9GUZ5peL5Pme6K6q6KnLOYEAQ5bmIqJZEzweIruD/snVGGUmzK 9xb7kqXMChigBKA++8mQmfL8Hxh6POVqR22Lg6/7RI0K8pvd2jSNSUDkHdfILseDcGDv xx1w3IvXgP82RIVYkFq/KHHKQUGWBJI59OBoYvXkccgDPnfh4mGN/zd0KrnBVH/4OaZy USreTCaA7uVYezMuSodFEiOkBLU3+CVT1OK0ftcT6NtgTC1gEX5HDAois0aynRylWn8+ UzcP7CwnMH6P9OTxfwPdBxghY9gYVRNkZyDYsmwmXCPFTqehGcokpr18lV7HtLFH3CI9 1BiQ== 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=OepyP7aJqQzWjHGpvR7FUTQ73uPtTxYksnFpem6ZMYk=; b=uhcJKcF03OHYXE6n06cIiE3GBAKe8QGMb5yjcY/Jfekn335f46N/NGFmRWdq4MR/b1 1gXZcU+FUfknsRXyAZYfmaIgQQ7nRPaXbeWJ5ghlNHZmn5LKmIhU6R95b9B9LyOQf4ue Q4RQeaWRoDkizPUS3F4dtuu5C6V0Wjo++O3zKVWorrRmmCkdqY+Mp7Y49kreaLstaUfE 4+4fS3jM2SAf/Q3zQdZ2KUBzSLe1CMvKOZ8fQE0LIvAYmL0pxJ4/e/FOz3Zfj1LI2zcy LHUzJjgbl0Z90aES4cIzSms6EMQ1nYsSfv7lPrnvNKySakIk2MRPuWnjqiHS3LL0IhDM JxSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 s13si1849060eja.102.2020.04.23.13.36.58; Thu, 23 Apr 2020 13:37:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726419AbgDWUeg (ORCPT + 99 others); Thu, 23 Apr 2020 16:34:36 -0400 Received: from fieldses.org ([173.255.197.46]:60220 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbgDWUeg (ORCPT ); Thu, 23 Apr 2020 16:34:36 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 308AE1BE2; Thu, 23 Apr 2020 16:34:35 -0400 (EDT) From: "J. Bruce Fields" To: linux-kernel@vger.kernel.org Cc: "J. Bruce Fields" Subject: [PATCH 1/2] nfsd4: common stateid-printing code Date: Thu, 23 Apr 2020 16:34:32 -0400 Message-Id: <1587674073-9551-1-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 e32ecedece0f..7537f2f5156e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2420,6 +2420,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; @@ -2435,7 +2440,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); @@ -2468,7 +2475,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, @@ -2497,7 +2506,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, ", @@ -2519,7 +2530,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.25.3