From patchwork Tue Feb 2 18:42:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 12062611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 594E2C433E6 for ; Tue, 2 Feb 2021 18:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2745064F88 for ; Tue, 2 Feb 2021 18:45:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238880AbhBBSo6 (ORCPT ); Tue, 2 Feb 2021 13:44:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238719AbhBBSn3 (ORCPT ); Tue, 2 Feb 2021 13:43:29 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA541C061788 for ; Tue, 2 Feb 2021 10:42:48 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id r20so12132670qtm.3 for ; Tue, 02 Feb 2021 10:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oQawKngObyoorCuyVqhiiQ0rHFSjPC2r0xk/zqMkP9U=; b=XZbs40kqCynL+FUvW4arogKxhjUU9ML/It0ttCXGHqr9i/6cfG3Aug/c7yO2FGkxQB yoH5PLjm8BibZKNxETVaElp5b84qPVlsgirUSdfGJCY3Lymao5s0efdY+UKcZD284DlH 3a+QPon+W4iSqmcBbeM6BYaDU+IfBlgBBbqTlcxi1JaZwKUrX+nON9q5bvD3jJZ1E72S Q/xBJyAudp6CfORFYOwRusr3Gum7AEfCuMP7TWsrCvm3c1Mh/vnbJbm/oqv6J06COFKq JVHFjvV2kVFfgAuWhjO3YlnCJtVim1zWtcfPVO/T3PsHOkOwBarD6iC+q7iX81OLYkpg YBLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oQawKngObyoorCuyVqhiiQ0rHFSjPC2r0xk/zqMkP9U=; b=q9cwDbkwfBCvtpFu/6wIqW0Mv49LTfgUsu3gln6XQ08QnzSlBl0M5Tqi6VKeAu4Bxh 7Ol86uTTpvEhe35RaXPufVRQ6QVmTHO6EB3EiJqoHaFLDbfCu4ddfVo+PuqpZ3zucau+ tq2YyP8IhjH2LyGN5LaujDFiPs23sc9pdoVl3cG/5BjhNm1j7d8PKIGkJUxjhWRCMsE7 e0olM6DOHOwwvQTyYpJoKuWJNK1uIgkIA4MIwy56NQiqs8jKn26VFsPxzuWCW0Sxs+Bp xNxEE0jdoEc8Wf6z7GE03pYgMdMXlPP+VrZrRVx3FkqAqzPQa/ZqJbkGWPSJOdDHedDT x6sA== X-Gm-Message-State: AOAM533CnX0wcwKslpnWLohuOMZik3rhdu36eYEwNuXocn3q9a/b4lIO x6ibOiQh7CpZikLHEg9In3wkxQ+/s7V39g== X-Google-Smtp-Source: ABdhPJyF7iLCR57e5wPDuyTuDo4KNTU+qC23zRVfR5Hae8ItNM5MeUNCWRTQJsss6Z4N3JAc2RGJsw== X-Received: by 2002:aed:3484:: with SMTP id x4mr20166047qtd.283.1612291367801; Tue, 02 Feb 2021 10:42:47 -0800 (PST) Received: from gouda.nowheycreamery.com (c-68-32-74-190.hsd1.mi.comcast.net. [68.32.74.190]) by smtp.gmail.com with ESMTPSA id k4sm7415906qtq.13.2021.02.02.10.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 10:42:47 -0800 (PST) Sender: Anna Schumaker From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH v2 1/5] sunrpc: Create a sunrpc directory under /sys/kernel/ Date: Tue, 2 Feb 2021 13:42:40 -0500 Message-Id: <20210202184244.288898-2-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> References: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker This is where we'll put per-rpc_client related files Signed-off-by: Anna Schumaker --- v2: Move directory from /sys/net/sunrpc/ to /sys/kernel/sunrpc/ --- net/sunrpc/Makefile | 2 +- net/sunrpc/sunrpc_syms.c | 8 ++++++++ net/sunrpc/sysfs.c | 20 ++++++++++++++++++++ net/sunrpc/sysfs.h | 13 +++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 net/sunrpc/sysfs.c create mode 100644 net/sunrpc/sysfs.h diff --git a/net/sunrpc/Makefile b/net/sunrpc/Makefile index 9488600451e8..1c8de397d6ad 100644 --- a/net/sunrpc/Makefile +++ b/net/sunrpc/Makefile @@ -12,7 +12,7 @@ sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \ auth.o auth_null.o auth_unix.o \ svc.o svcsock.o svcauth.o svcauth_unix.o \ addr.o rpcb_clnt.o timer.o xdr.o \ - sunrpc_syms.o cache.o rpc_pipe.o \ + sunrpc_syms.o cache.o rpc_pipe.o sysfs.o \ svc_xprt.o \ xprtmultipath.o sunrpc-$(CONFIG_SUNRPC_DEBUG) += debugfs.o diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 236fadc4a439..3b57efc692ec 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c @@ -24,6 +24,7 @@ #include #include "sunrpc.h" +#include "sysfs.h" #include "netns.h" unsigned int sunrpc_net_id; @@ -103,6 +104,10 @@ init_sunrpc(void) if (err) goto out4; + err = rpc_sysfs_init(); + if (err) + goto out5; + sunrpc_debugfs_init(); #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) rpc_register_sysctl(); @@ -111,6 +116,8 @@ init_sunrpc(void) init_socket_xprt(); /* clnt sock transport */ return 0; +out5: + unregister_rpc_pipefs(); out4: unregister_pernet_subsys(&sunrpc_net_ops); out3: @@ -124,6 +131,7 @@ init_sunrpc(void) static void __exit cleanup_sunrpc(void) { + rpc_sysfs_exit(); rpc_cleanup_clids(); rpcauth_remove_module(); cleanup_socket_xprt(); diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c new file mode 100644 index 000000000000..fbb8db50eb29 --- /dev/null +++ b/net/sunrpc/sysfs.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020 Anna Schumaker + */ +#include + +static struct kset *rpc_client_kset; + +int rpc_sysfs_init(void) +{ + rpc_client_kset = kset_create_and_add("sunrpc", NULL, kernel_kobj); + if (!rpc_client_kset) + return -ENOMEM; + return 0; +} + +void rpc_sysfs_exit(void) +{ + kset_unregister(rpc_client_kset); +} diff --git a/net/sunrpc/sysfs.h b/net/sunrpc/sysfs.h new file mode 100644 index 000000000000..93c3cd220506 --- /dev/null +++ b/net/sunrpc/sysfs.h @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020 Anna Schumaker + */ +#ifndef __SUNRPC_SYSFS_H +#define __SUNRPC_SYSFS_H + +extern struct kobject *rpc_client_kobj; + +extern int rpc_sysfs_init(void); +extern void rpc_sysfs_exit(void); + +#endif From patchwork Tue Feb 2 18:42:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 12062619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2A0CC433E9 for ; Tue, 2 Feb 2021 18:45:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC16564E34 for ; Tue, 2 Feb 2021 18:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238836AbhBBSp2 (ORCPT ); Tue, 2 Feb 2021 13:45:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238885AbhBBSna (ORCPT ); Tue, 2 Feb 2021 13:43:30 -0500 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE141C06178A for ; Tue, 2 Feb 2021 10:42:49 -0800 (PST) Received: by mail-qk1-x730.google.com with SMTP id d85so20823417qkg.5 for ; Tue, 02 Feb 2021 10:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=75jpej1TQ9Hzb65iteJ+9BRTqwnRgVEfPYAU4FruI/w=; b=V+MaJkgg2euLrFA8OK7wvIWiTRWMd44RJh8w3W8OlYj43jnd6Z3ROIPOXQMc6fQYo5 s3zzSZ7kdabPAEHcPY8Ik5my92wqFi5j+PkJKATIRoB1sshpKbiJ34viCEtcqmiPi1kn 0PZdiuTWJse+fw0RpV1KVkbagcEF3Bsuky8SdtSLqKoIWbhw5dt/AyiUyNAk5hjM2BTO AWw0UI9S/DaAXjwrgqhls1Y7Jg+W7lhlN1scxhg6aUpyU1kJz1HbRRs4n42+fPSctD4O jRKdwu3WQFsShBfjrYwGzcT7EI6s3NygrmqnEjd1hzn6qiHhA65mQioRamCaMaFMTzog s9lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=75jpej1TQ9Hzb65iteJ+9BRTqwnRgVEfPYAU4FruI/w=; b=oOFaFivFoUlV/lBXaIy+5ArYchKCjIGWMovKKm1UDv/jJK13+4+WgVNKuptc5De0JJ sEm4vv5IwVwtq/rg4fT39puZAeefr2gkW9IpSJYsxyS7HrWuJQ6YAkW2XrofzzNYbdAM /im/FUfaVGOVaVl7/PKY/uCYfS6CddVgiTXt/PbcUx9z5EDvdL5g9k+rQl29UJcfQdvV 1YoOfC2sRyVzum5uRu4QCRcazJ2IAtQmZAJQsYw9LQultLc5VvkY4hVAwp8wuGV+yNDz ybesuqnWZQ/gcNm6BJEtanz+2doqu6Ss/D0+s6Zk81kqFrLm3YG2WSqxOKPhKVvpwok4 58Ww== X-Gm-Message-State: AOAM531r6SR+nkcyiLrixhSk6gvfFgdF/UoakeM2z1i4La8HI2pcYHVr z9mGNyn+v1prdh1yTUBnDudq6n7R9bNYuw== X-Google-Smtp-Source: ABdhPJxyyLRnObFfY71gh1XOdlTFpAFNXVEJ+8HDVSVqYI0C16Ay93H7JvCNvx5+IPix9E9UuQJAsw== X-Received: by 2002:ae9:dfc4:: with SMTP id t187mr21859371qkf.299.1612291368877; Tue, 02 Feb 2021 10:42:48 -0800 (PST) Received: from gouda.nowheycreamery.com (c-68-32-74-190.hsd1.mi.comcast.net. [68.32.74.190]) by smtp.gmail.com with ESMTPSA id k4sm7415906qtq.13.2021.02.02.10.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 10:42:48 -0800 (PST) Sender: Anna Schumaker From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH v2 2/5] sunrpc: Create a net/ subdirectory in the sunrpc sysfs Date: Tue, 2 Feb 2021 13:42:41 -0500 Message-Id: <20210202184244.288898-3-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> References: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker For network namespace separation. Signed-off-by: Anna Schumaker --- net/sunrpc/sysfs.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c index fbb8db50eb29..ad6a5de5927c 100644 --- a/net/sunrpc/sysfs.c +++ b/net/sunrpc/sysfs.c @@ -2,19 +2,60 @@ /* * Copyright (c) 2020 Anna Schumaker */ +#include #include +struct kobject *rpc_client_kobj; static struct kset *rpc_client_kset; +static void rpc_netns_object_release(struct kobject *kobj) +{ + kfree(kobj); +} + +static const struct kobj_ns_type_operations *rpc_netns_object_child_ns_type( + struct kobject *kobj) +{ + return &net_ns_type_operations; +} + +static struct kobj_type rpc_netns_object_type = { + .release = rpc_netns_object_release, + .sysfs_ops = &kobj_sysfs_ops, + .child_ns_type = rpc_netns_object_child_ns_type, +}; + +static struct kobject *rpc_netns_object_alloc(const char *name, + struct kset *kset, struct kobject *parent) +{ + struct kobject *kobj; + kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + if (kobj) { + kobj->kset = kset; + if (kobject_init_and_add(kobj, &rpc_netns_object_type, + parent, "%s", name) == 0) + return kobj; + kobject_put(kobj); + } + return NULL; +} + int rpc_sysfs_init(void) { rpc_client_kset = kset_create_and_add("sunrpc", NULL, kernel_kobj); if (!rpc_client_kset) return -ENOMEM; + rpc_client_kobj = rpc_netns_object_alloc("net", rpc_client_kset, NULL); + if (!rpc_client_kobj) { + kset_unregister(rpc_client_kset); + rpc_client_kset = NULL; + return -ENOMEM; + } return 0; } void rpc_sysfs_exit(void) { + kobject_put(rpc_client_kobj); kset_unregister(rpc_client_kset); } From patchwork Tue Feb 2 18:42:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 12062615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56819C433E6 for ; Tue, 2 Feb 2021 18:45:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FC0864E4F for ; Tue, 2 Feb 2021 18:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238926AbhBBSpL (ORCPT ); Tue, 2 Feb 2021 13:45:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238887AbhBBSnd (ORCPT ); Tue, 2 Feb 2021 13:43:33 -0500 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0CF2C06178B for ; Tue, 2 Feb 2021 10:42:50 -0800 (PST) Received: by mail-qk1-x730.google.com with SMTP id 19so20833444qkh.3 for ; Tue, 02 Feb 2021 10:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lBmHt1rrvqpyo6sP+0tgagNxOPtsPmr5NeaVYzWr5OQ=; b=diPocqqNWdJf6arYKvAIRrigl+iKp5QQSWHTs0L5HJ4g+IEX6JDGWlZdx5OBls5f7w HcRBGBfU89OKU6h1GWqEmy8M5Ry4vor8JRK9N8Ij3hQ7zDh4lhF+V6RvmgrcsAM/AT1f xDINMSt8dQ5vF9pvjB427gcoff3vcu9Euvzl+Il8KkrHlawDCpfrRUfsceYmrZGPx0s0 0+5EUP0+FlhJjM3er+ISnbojPWH1kO7ImLdyy6kQqj5iXKTfGHUyJBKD+HBNHVDCYVZj PvQnayeu705BrZLr8nsCUgxCSgQReG3o8nd0JKhZRfhvkwsRtsVB7xzIPMA50d55OsHK qZjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=lBmHt1rrvqpyo6sP+0tgagNxOPtsPmr5NeaVYzWr5OQ=; b=q32WixW3rdUTcMWhXwSTt9oAUYk17inDnhruyNnvSMfKeP0V32tx1Rit+Ljosnj7Nb vkNBk+gd9+U2wMOr9W0ikSwZc2wRrgtuAvXZ2ifiWSp1ZbpE7t8v5iTGiAgHIRNAdlJG oRVrDWUMlg1CXQ2AzXqWvhyjC1Zbafxx83rEpYBKtEPoKgpcoS1OoaWsi0cjQsMLoCqP XBeXzm0/WNynKu/kkXWKQAgucT0HOkxphKfs//ekONGXKXtO6rFcBrIv5P62M+RUnMKa ygD7LgkqT3PMNBEuyaI9DxXmL7vz68ymhoqveWKlN4MIPcpNWYp804S35v9QfjPSRxjn C8JQ== X-Gm-Message-State: AOAM530So7Rs2f5Pufroy47s/NBB7VmHu+qnqJfPRsN0fHLbwll7CJ5X moiYDa0inm0k8bbYblumbnqtKqEQxqWDiw== X-Google-Smtp-Source: ABdhPJy7dpmNm5dXKQXHZSsw/vD6YiIG9bRZatX9kUdmFQVt3ze/CK+/9O1jN5me4qTCmft5nlKCzw== X-Received: by 2002:a37:c03:: with SMTP id 3mr23193730qkm.367.1612291369858; Tue, 02 Feb 2021 10:42:49 -0800 (PST) Received: from gouda.nowheycreamery.com (c-68-32-74-190.hsd1.mi.comcast.net. [68.32.74.190]) by smtp.gmail.com with ESMTPSA id k4sm7415906qtq.13.2021.02.02.10.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 10:42:49 -0800 (PST) Sender: Anna Schumaker From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH v2 3/5] sunrpc: Create per-rpc_clnt sysfs kobjects Date: Tue, 2 Feb 2021 13:42:42 -0500 Message-Id: <20210202184244.288898-4-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> References: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker These will eventually have files placed under them for sysfs operations. Signed-off-by: Anna Schumaker --- include/linux/sunrpc/clnt.h | 1 + net/sunrpc/clnt.c | 5 ++++ net/sunrpc/sysfs.c | 60 +++++++++++++++++++++++++++++++++++++ net/sunrpc/sysfs.h | 8 +++++ 4 files changed, 74 insertions(+) diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 02e7a5863d28..503653720e18 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -71,6 +71,7 @@ struct rpc_clnt { #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) struct dentry *cl_debugfs; /* debugfs directory */ #endif + void *cl_sysfs; /* sysfs directory */ /* cl_work is only needed after cl_xpi is no longer used, * and that are of similar size */ diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 612f0a641f4c..02905eae5c0a 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -41,6 +41,7 @@ #include #include "sunrpc.h" +#include "sysfs.h" #include "netns.h" #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) @@ -300,6 +301,7 @@ static int rpc_client_register(struct rpc_clnt *clnt, int err; rpc_clnt_debugfs_register(clnt); + rpc_netns_sysfs_setup(clnt, net); pipefs_sb = rpc_get_sb_net(net); if (pipefs_sb) { @@ -327,6 +329,7 @@ static int rpc_client_register(struct rpc_clnt *clnt, out: if (pipefs_sb) rpc_put_sb_net(net); + rpc_netns_sysfs_destroy(clnt); rpc_clnt_debugfs_unregister(clnt); return err; } @@ -733,6 +736,7 @@ int rpc_switch_client_transport(struct rpc_clnt *clnt, rpc_unregister_client(clnt); __rpc_clnt_remove_pipedir(clnt); + rpc_netns_sysfs_destroy(clnt); rpc_clnt_debugfs_unregister(clnt); /* @@ -879,6 +883,7 @@ static void rpc_free_client_work(struct work_struct *work) * so they cannot be called in rpciod, so they are handled separately * here. */ + rpc_netns_sysfs_destroy(clnt); rpc_clnt_debugfs_unregister(clnt); rpc_free_clid(clnt); rpc_clnt_remove_pipedir(clnt); diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c index ad6a5de5927c..42a690f8bb52 100644 --- a/net/sunrpc/sysfs.c +++ b/net/sunrpc/sysfs.c @@ -4,6 +4,7 @@ */ #include #include +#include "sysfs.h" struct kobject *rpc_client_kobj; static struct kset *rpc_client_kset; @@ -54,8 +55,67 @@ int rpc_sysfs_init(void) return 0; } +static void rpc_netns_client_release(struct kobject *kobj) +{ + struct rpc_netns_client *c; + + c = container_of(kobj, struct rpc_netns_client, kobject); + kfree(c); +} + +static const void *rpc_netns_client_namespace(struct kobject *kobj) +{ + return container_of(kobj, struct rpc_netns_client, kobject)->net; +} + +static struct kobj_type rpc_netns_client_type = { + .release = rpc_netns_client_release, + .sysfs_ops = &kobj_sysfs_ops, + .namespace = rpc_netns_client_namespace, +}; + void rpc_sysfs_exit(void) { kobject_put(rpc_client_kobj); kset_unregister(rpc_client_kset); } + +static struct rpc_netns_client *rpc_netns_client_alloc(struct kobject *parent, + struct net *net, int clid) +{ + struct rpc_netns_client *p; + + p = kzalloc(sizeof(*p), GFP_KERNEL); + if (p) { + p->net = net; + p->kobject.kset = rpc_client_kset; + if (kobject_init_and_add(&p->kobject, &rpc_netns_client_type, + parent, "%d", clid) == 0) + return p; + kobject_put(&p->kobject); + } + return NULL; +} + +void rpc_netns_sysfs_setup(struct rpc_clnt *clnt, struct net *net) +{ + struct rpc_netns_client *rpc_client; + + rpc_client = rpc_netns_client_alloc(rpc_client_kobj, net, clnt->cl_clid); + if (rpc_client) { + clnt->cl_sysfs = rpc_client; + kobject_uevent(&rpc_client->kobject, KOBJ_ADD); + } +} + +void rpc_netns_sysfs_destroy(struct rpc_clnt *clnt) +{ + struct rpc_netns_client *rpc_client = clnt->cl_sysfs; + + if (rpc_client) { + kobject_uevent(&rpc_client->kobject, KOBJ_REMOVE); + kobject_del(&rpc_client->kobject); + kobject_put(&rpc_client->kobject); + clnt->cl_sysfs = NULL; + } +} diff --git a/net/sunrpc/sysfs.h b/net/sunrpc/sysfs.h index 93c3cd220506..279a836594e7 100644 --- a/net/sunrpc/sysfs.h +++ b/net/sunrpc/sysfs.h @@ -5,9 +5,17 @@ #ifndef __SUNRPC_SYSFS_H #define __SUNRPC_SYSFS_H +struct rpc_netns_client { + struct kobject kobject; + struct net *net; +}; + extern struct kobject *rpc_client_kobj; extern int rpc_sysfs_init(void); extern void rpc_sysfs_exit(void); +void rpc_netns_sysfs_setup(struct rpc_clnt *clnt, struct net *net); +void rpc_netns_sysfs_destroy(struct rpc_clnt *clnt); + #endif From patchwork Tue Feb 2 18:42:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 12062613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38CF7C433DB for ; Tue, 2 Feb 2021 18:45:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0890B64E34 for ; Tue, 2 Feb 2021 18:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238922AbhBBSpG (ORCPT ); Tue, 2 Feb 2021 13:45:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238884AbhBBSnd (ORCPT ); Tue, 2 Feb 2021 13:43:33 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B07C06178C for ; Tue, 2 Feb 2021 10:42:51 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id c1so15728548qtc.1 for ; Tue, 02 Feb 2021 10:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SW9sK2N6g/Ta8eXWJeE/yuBYQzAt4OFHO0Wdl6GzXf4=; b=Z0n6cm6RGORANB+uPMJVaqhKT7lNKEZI84TzlWz40f9cyfMSBdR4Vp1NOXtIVZFFXI fJG2ytMI0yfcJc6hCn8yJCiD1pqems3K/o1W9ngHDJEEr/g6CghQR9zRxkp4MM4O4hVK /4Z7s2K+bFo0Vged3xpdfEzcne3o5ed/rGYKNmwBqV0+Bd/YGiYXx5/bHZdZ2CugFV2E REvRQ+mVjHHJ8Y1QklzqTh2FGfwX1xmwNjaBLEqsob+JNdU6RevGYZNCG0mGfA6s81b6 k+gsTtiBkr+bOWLETO28dSKbcdHOcwwLNcgms5iepYZlYLEW/tEJVAUGNbtZzxF+eif5 wuZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SW9sK2N6g/Ta8eXWJeE/yuBYQzAt4OFHO0Wdl6GzXf4=; b=cK0OHda0PKTA3nNaf4x847DBtEXvLKu/GFJU9MMDEgiES9qBHCJJlHHdeS/p477ZoL qZs31drtLcBV9DAsA74Z/yXzKHmVc+Jl0AbQH20sq9nZGltKc5YRi1OPDMiE514Yg6sJ +5CdK1UwQ4EX4P4BUt+aLbQPgmozuMz60+4OUkSVRc93ci6Mrf6lvVQ9teBp8W4mMib1 YeOY58dyfNHun2lDZ3S3LzatNMDpnGUaNaPn4rDqQ0n7Zur8dcWHptj4WpvzC4YS9EN1 ZSIkD0egksrees9A2zmR26MVDXJkYPzQPUGx36Q8CYDcXgF+9xiE/8K0/g7G1OS1aQJv vPkg== X-Gm-Message-State: AOAM5300H4WuCYGvTsu5tNG3rYNC2GZwzQq427ZdtxmR70T1/M/j3J/p O6ZHTHP5yd8ZMDcbM4BcPQgm7xCU91AR7g== X-Google-Smtp-Source: ABdhPJyFKHzGvoAAyhoqD5qaQwJtNJkyuktVjwBfG8PLIPKw7WbRCVCLVP5Mt9Vd7vHsHWct1+fH2g== X-Received: by 2002:ac8:7c95:: with SMTP id y21mr21743576qtv.199.1612291370907; Tue, 02 Feb 2021 10:42:50 -0800 (PST) Received: from gouda.nowheycreamery.com (c-68-32-74-190.hsd1.mi.comcast.net. [68.32.74.190]) by smtp.gmail.com with ESMTPSA id k4sm7415906qtq.13.2021.02.02.10.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 10:42:50 -0800 (PST) Sender: Anna Schumaker From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH v2 4/5] sunrpc: Prepare xs_connect() for taking NULL tasks Date: Tue, 2 Feb 2021 13:42:43 -0500 Message-Id: <20210202184244.288898-5-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> References: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker We won't have a task structure when we go to change IP addresses, so check for one before calling the WARN_ON() to avoid crashing. Signed-off-by: Anna Schumaker --- net/sunrpc/xprtsock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index c56a66cdf4ac..250abf1aa018 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2311,7 +2311,8 @@ static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task) struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); unsigned long delay = 0; - WARN_ON_ONCE(!xprt_lock_connect(xprt, task, transport)); + if (task) + WARN_ON_ONCE(!xprt_lock_connect(xprt, task, transport)); if (transport->sock != NULL) { dprintk("RPC: xs_connect delayed xprt %p for %lu " From patchwork Tue Feb 2 18:42:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 12062617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51121C433E0 for ; Tue, 2 Feb 2021 18:45:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E2BD64E36 for ; Tue, 2 Feb 2021 18:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238935AbhBBSpZ (ORCPT ); Tue, 2 Feb 2021 13:45:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238836AbhBBSnd (ORCPT ); Tue, 2 Feb 2021 13:43:33 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7745C061793 for ; Tue, 2 Feb 2021 10:42:52 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id l23so15664252qtq.13 for ; Tue, 02 Feb 2021 10:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dQb0xnCqDeXmHQy6ABEXqRVe5Ozah2A2c9Qh6FPP7/Q=; b=eZ8/hXeezCtmm+7fZodHs9faaMKa8Rab1GNPLN/4VOsZwBvhD6qkkVfEXQ5I9Sbr+B QVX+vh7pal25wROgfLWkVgMWcEi3hakTF8Jr1L38XraL+mu+Qw5KcJAnFGX8gmyyMHHw wyVpBVQo4lp/H2cLJXV0NazuMl0hjW5k3gBapRFRyKLmD2bXt/IeoPBwmOtMPlCw2nEC zHtNmafr4aHQ+dzsVLyS4gVBlAi0zn3rnjkr4YwNQxcWDxHWFluXBjKH01iR94inKaZl a/EmwC67ZsD08S8eI2JZWRLifO9dKj6eXkZQds/y6YzTMq4/JA3euHaf1OLPADrTYNpq 2LjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dQb0xnCqDeXmHQy6ABEXqRVe5Ozah2A2c9Qh6FPP7/Q=; b=EYdYJLVc3OLcmtiPgpnas4WMAebABE1pgT81L1JwHVD4npzGRkA4hoQxhI+fcx0p3r Suq0rnA90Od3ZMxf6xmaOdYTx7WK5Xjv+V9yuaEWIQWfF9gPKKHS5kyTx8oSispj2e6d KGPTu8LamQuST7KHad5Xp6Kj5XOwKDj7bHh4ui6GlguOASczapk22QY8lVeWGBSYKzVc 6OchJjZ2MVqApO49vQtKsjeij17sIDMCfKdlOHUibuen900Oa48YVLQ9Yosvx2/aG5gO UBiFxRUZ+UjwNs13hBQdjLdroVOiM8b6BgQh+AY+jTfAehRaTp69nikodKbFl+RyuCKI WFrQ== X-Gm-Message-State: AOAM533+MMpWTMOVP1Y52gLAgpp5t55EzI0b5sYnCW6+DdonPtMddMZJ QiOZle/Qrh6rwE3OfuorUfsCRuHQxFTccw== X-Google-Smtp-Source: ABdhPJz11lHvyzKEeIKu5kDaol/z5QI8/k9PEMgAh53peNvq7TaOQsoZEyqEnqfV+n7e/2dAYt7mAw== X-Received: by 2002:ac8:6bcf:: with SMTP id b15mr21167736qtt.34.1612291371897; Tue, 02 Feb 2021 10:42:51 -0800 (PST) Received: from gouda.nowheycreamery.com (c-68-32-74-190.hsd1.mi.comcast.net. [68.32.74.190]) by smtp.gmail.com with ESMTPSA id k4sm7415906qtq.13.2021.02.02.10.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 10:42:51 -0800 (PST) Sender: Anna Schumaker From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH v2 5/5] sunrpc: Create a per-rpc_clnt file for managing the destination IP address Date: Tue, 2 Feb 2021 13:42:44 -0500 Message-Id: <20210202184244.288898-6-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> References: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker Reading the file displays the current destination address, and writing to it allows users to change the address. And since we're using IP here, restrict to only creating sysfs files for TCP and RDMA connections. Signed-off-by: Anna Schumaker --- v2: Change filename and related functions from "address" to "dstaddr" Combine patches for reading and writing to this file --- net/sunrpc/sysfs.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ net/sunrpc/sysfs.h | 1 + 2 files changed, 48 insertions(+) diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c index 42a690f8bb52..8b01b4df64ee 100644 --- a/net/sunrpc/sysfs.c +++ b/net/sunrpc/sysfs.c @@ -3,6 +3,8 @@ * Copyright (c) 2020 Anna Schumaker */ #include +#include +#include #include #include "sysfs.h" @@ -55,6 +57,37 @@ int rpc_sysfs_init(void) return 0; } +static ssize_t rpc_netns_dstaddr_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct rpc_netns_client *c = container_of(kobj, + struct rpc_netns_client, kobject); + struct rpc_clnt *clnt = c->clnt; + struct rpc_xprt *xprt = rcu_dereference(clnt->cl_xprt); + + return rpc_ntop((struct sockaddr *)&xprt->addr, buf, PAGE_SIZE); +} + +static ssize_t rpc_netns_dstaddr_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + struct rpc_netns_client *c = container_of(kobj, + struct rpc_netns_client, kobject); + struct rpc_clnt *clnt = c->clnt; + struct rpc_xprt *xprt = rcu_dereference(clnt->cl_xprt); + struct sockaddr *saddr = (struct sockaddr *)&xprt->addr; + int port = rpc_get_port(saddr); + + xprt->addrlen = rpc_pton(xprt->xprt_net, buf, count - 1, saddr, sizeof(*saddr)); + rpc_set_port(saddr, port); + + kfree(xprt->address_strings[RPC_DISPLAY_ADDR]); + xprt->address_strings[RPC_DISPLAY_ADDR] = kstrndup(buf, count - 1, GFP_KERNEL); + + xprt->ops->connect(xprt, NULL); + return count; +} + static void rpc_netns_client_release(struct kobject *kobj) { struct rpc_netns_client *c; @@ -68,8 +101,17 @@ static const void *rpc_netns_client_namespace(struct kobject *kobj) return container_of(kobj, struct rpc_netns_client, kobject)->net; } +static struct kobj_attribute rpc_netns_client_dstaddr = __ATTR(dstaddr, + 0644, rpc_netns_dstaddr_show, rpc_netns_dstaddr_store); + +static struct attribute *rpc_netns_client_attrs[] = { + &rpc_netns_client_dstaddr.attr, + NULL, +}; + static struct kobj_type rpc_netns_client_type = { .release = rpc_netns_client_release, + .default_attrs = rpc_netns_client_attrs, .sysfs_ops = &kobj_sysfs_ops, .namespace = rpc_netns_client_namespace, }; @@ -100,10 +142,15 @@ static struct rpc_netns_client *rpc_netns_client_alloc(struct kobject *parent, void rpc_netns_sysfs_setup(struct rpc_clnt *clnt, struct net *net) { struct rpc_netns_client *rpc_client; + struct rpc_xprt *xprt = rcu_dereference(clnt->cl_xprt); + + if (!(xprt->prot & (IPPROTO_TCP | XPRT_TRANSPORT_RDMA))) + return; rpc_client = rpc_netns_client_alloc(rpc_client_kobj, net, clnt->cl_clid); if (rpc_client) { clnt->cl_sysfs = rpc_client; + rpc_client->clnt = clnt; kobject_uevent(&rpc_client->kobject, KOBJ_ADD); } } diff --git a/net/sunrpc/sysfs.h b/net/sunrpc/sysfs.h index 279a836594e7..137a12c87954 100644 --- a/net/sunrpc/sysfs.h +++ b/net/sunrpc/sysfs.h @@ -8,6 +8,7 @@ struct rpc_netns_client { struct kobject kobject; struct net *net; + struct rpc_clnt *clnt; }; extern struct kobject *rpc_client_kobj;