Linux NFS development
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 09/10] nfs: convert to kobject_del_and_put()
Date: Sun, 19 Mar 2023 16:41:32 +0800	[thread overview]
Message-ID: <20230319084134.11804-9-frank.li@vivo.com> (raw)
In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com>

Use kobject_del_and_put() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/nfs/sysfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c
index 0cbcd2dfa732..a6072be5fa5a 100644
--- a/fs/nfs/sysfs.c
+++ b/fs/nfs/sysfs.c
@@ -185,8 +185,7 @@ void nfs_netns_sysfs_destroy(struct nfs_net *netns)
 
 	if (clp) {
 		kobject_uevent(&clp->kobject, KOBJ_REMOVE);
-		kobject_del(&clp->kobject);
-		kobject_put(&clp->kobject);
+		kobject_del_and_put(&clp->kobject);
 		netns->nfs_client = NULL;
 	}
 }
-- 
2.35.1


           reply	other threads:[~2023-03-19  8:43 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20230319084134.11804-1-frank.li@vivo.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230319084134.11804-9-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox