Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2575627rwr; Fri, 21 Apr 2023 10:41:52 -0700 (PDT) X-Google-Smtp-Source: AKy350aFfbWKlyygXGRm/+O3yBuGHD0flYvEEyPUKOfYg58evSsifCJd0szPZp57XEClcf7sfcSC X-Received: by 2002:a17:90a:7607:b0:23d:4e9d:2eb0 with SMTP id s7-20020a17090a760700b0023d4e9d2eb0mr6007328pjk.36.1682098911663; Fri, 21 Apr 2023 10:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682098911; cv=none; d=google.com; s=arc-20160816; b=V4c2GhddFXCVRQdJvdGnvOVDJVZK20r/88PBwNvVP/ENUdIW+Czgq1NurBJ+LnS5qM QTN52M7E9ffBKwik0+AGzI/VuUVqQHt5VyaZxJtavXwO3/t+gB9yauqHylIhirfZPCEG eAxn94C3eTjvGYvLlE2gSewwjOomfJb5d/k8AyD1CktHLHYu2x9O8KPcqyGl04so1rvM 5yk7wRua9KBLo/7xT9z5Dokk/zmF6EANZLtyNFPDQsHiUeiBTb6zWEmqbSWmulm4Db1c 43xiBHq9KqTVo44klTUBZo0myzOyMPoKRJL+Xht4hv3Pl74ymHH1WK92uprfW+Km8HjV WPiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=mDT2xZslmwC5RymDr+i2C+SpKbLu+XFfhz6wrT81Es4=; b=M5JiZpVyQYXfqjwgAjmtVCv36bJKLuU6FpEq1nEd+aegiePKxNPjUSIKCv3NgzafvN nRzyTaT+0gVkEYY1cwvCdp1swJif1LJGiUrA201fdg8weVrcTFypaLoZMEW3R8uVCx2U qD0XALZRcbYOqRipxruNbjikVaEjgiObqGiIFOJjMwDHEyuGgXsSaFuC2Yaw+B9iScgf A1yN4JstnpgMADCiHA6lIbs+kW/Ls3JKPBVNH3+LBtn4BXaz1R2mOn9WbGZ/cREYEOuE ZW80RE6qKx4UPp9VgqndFriz/2+mwnSQCGC8/BEv7lw+fFi58Q091XUxPVaCnZwzFfm6 88UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jCWCi4Ck; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a17090ab00200b0024495c4a090si7390294pjq.107.2023.04.21.10.41.40; Fri, 21 Apr 2023 10:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jCWCi4Ck; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232197AbjDURUL (ORCPT + 99 others); Fri, 21 Apr 2023 13:20:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbjDURUJ (ORCPT ); Fri, 21 Apr 2023 13:20:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A06DB76F for ; Fri, 21 Apr 2023 10:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682097524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mDT2xZslmwC5RymDr+i2C+SpKbLu+XFfhz6wrT81Es4=; b=jCWCi4CkeW0CHgoAgmH7a41ZsyISL4PofGStGBMpSw7aoVmN1Z3xyBMof0cupkFQwmah7d Ca9gFJTlLNqdQlY1BvaGSUb0f3zn38FVE1VDdirLaMJuWPrrxk55tajMArCq8EoyUwmx0d gXzZ2OoHJBDf4B21RZuss5FiVrE/zJs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-WwwBJLuOO0CW3ame2oLxAA-1; Fri, 21 Apr 2023 13:18:43 -0400 X-MC-Unique: WwwBJLuOO0CW3ame2oLxAA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 67DC51C0A5AC for ; Fri, 21 Apr 2023 17:18:43 +0000 (UTC) Received: from bcodding.csb.redhat.com (ovpn-0-3.rdu2.redhat.com [10.22.0.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2189440C2064 for ; Fri, 21 Apr 2023 17:18:42 +0000 (UTC) From: Benjamin Coddington To: linux-nfs@vger.kernel.org Subject: [PATCH 5/9] NFS: add a sysfs link to the lockd rpc_client Date: Fri, 21 Apr 2023 13:18:35 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org After lockd is started, add a symlink for lockd's rpc_client under NFS' superblock sysfs. Signed-off-by: Benjamin Coddington --- fs/lockd/clntlock.c | 6 ++++++ fs/nfs/client.c | 1 + include/linux/lockd/bind.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index a5bb3f721a9d..0340e10b5715 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c @@ -94,6 +94,12 @@ void nlmclnt_done(struct nlm_host *host) } EXPORT_SYMBOL_GPL(nlmclnt_done); +struct rpc_clnt *nlmclnt_rpc_clnt(struct nlm_host *host) +{ + return host->h_rpcclnt; +} +EXPORT_SYMBOL_GPL(nlmclnt_rpc_clnt); + /* * Queue up a lock for blocking so that the GRANTED request can see it */ diff --git a/fs/nfs/client.c b/fs/nfs/client.c index de275f1fde92..eede8c28a56b 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -592,6 +592,7 @@ static int nfs_start_lockd(struct nfs_server *server) server->nlm_host = host; server->destroy = nfs_destroy_server; + nfs_sysfs_link_rpc_client(server, nlmclnt_rpc_clnt(host), NULL); return 0; } diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 3bc9f7410e21..c53c81242e72 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h @@ -20,6 +20,7 @@ /* Dummy declarations */ struct svc_rqst; struct rpc_task; +struct rpc_clnt; /* * This is the set of functions for lockd->nfsd communication @@ -56,6 +57,7 @@ struct nlmclnt_initdata { extern struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init); extern void nlmclnt_done(struct nlm_host *host); +extern struct rpc_clnt *nlmclnt_rpc_clnt(struct nlm_host *host); /* * NLM client operations provide a means to modify RPC processing of NLM -- 2.39.2