public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	kinglongmee@gmail.com
Subject: [PATCH 3/8 v2] nfs: Use remove_proc_subtree() instead remove_proc_entry()
Date: Wed, 01 Jul 2015 23:00:29 +0800	[thread overview]
Message-ID: <5594008D.8080909@gmail.com> (raw)
In-Reply-To: <20150701052007.GA17109@ZenIV.linux.org.uk>

Thanks for Al Viro's comments of killing proc_fs_nfs completely.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfs/client.c | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 892aeff..3e8781d 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1193,8 +1193,6 @@ void nfs_clients_init(struct net *net)
 }
 
 #ifdef CONFIG_PROC_FS
-static struct proc_dir_entry *proc_fs_nfs;
-
 static int nfs_server_list_open(struct inode *inode, struct file *file);
 static void *nfs_server_list_start(struct seq_file *p, loff_t *pos);
 static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);
@@ -1434,27 +1432,20 @@ void nfs_fs_proc_net_exit(struct net *net)
  */
 int __init nfs_fs_proc_init(void)
 {
-	struct proc_dir_entry *p;
-
-	proc_fs_nfs = proc_mkdir("fs/nfsfs", NULL);
-	if (!proc_fs_nfs)
+	if (!proc_mkdir("fs/nfsfs", NULL))
 		goto error_0;
 
 	/* a file of servers with which we're dealing */
-	p = proc_symlink("servers", proc_fs_nfs, "../../net/nfsfs/servers");
-	if (!p)
+	if (!proc_symlink("fs/nfsfs/servers", NULL, "../../net/nfsfs/servers"))
 		goto error_1;
 
 	/* a file of volumes that we have mounted */
-	p = proc_symlink("volumes", proc_fs_nfs, "../../net/nfsfs/volumes");
-	if (!p)
-		goto error_2;
-	return 0;
+	if (!proc_symlink("fs/nfsfs/volumes", NULL, "../../net/nfsfs/volumes"))
+		goto error_1;
 
-error_2:
-	remove_proc_entry("servers", proc_fs_nfs);
+	return 0;
 error_1:
-	remove_proc_entry("fs/nfsfs", NULL);
+	remove_proc_subtree("fs/nfsfs", NULL);
 error_0:
 	return -ENOMEM;
 }
@@ -1464,9 +1455,7 @@ error_0:
  */
 void nfs_fs_proc_exit(void)
 {
-	remove_proc_entry("volumes", proc_fs_nfs);
-	remove_proc_entry("servers", proc_fs_nfs);
-	remove_proc_entry("fs/nfsfs", NULL);
+	remove_proc_subtree("fs/nfsfs", NULL);
 }
 
 #endif /* CONFIG_PROC_FS */
-- 
2.4.3


  parent reply	other threads:[~2015-07-01 15:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  3:54 [PATCH 1/8] nfs: Fix a memory leak when meeting an unsupported state protect Kinglong Mee
2015-07-01  3:55 ` [PATCH 2/8] nfs: Remove unused argument in nfs_server_set_fsinfo() Kinglong Mee
2015-07-01  3:56 ` [PATCH 3/8] nfs: Use remove_proc_subtree() instead remove_proc_entry() Kinglong Mee
2015-07-01  5:20   ` Al Viro
2015-07-01 14:58     ` Kinglong Mee
2015-07-01 15:00     ` Kinglong Mee [this message]
2015-07-01  3:57 ` [PATCH 4/8] nfs: Don't setting FILE_CREATED flags always Kinglong Mee
2015-07-01  3:58 ` [PATCH 5/8] nfs: Remove unneeded micro checking of CONFIG_PROC_FS Kinglong Mee
2015-07-01  3:59 ` [PATCH 6/8] nfs: Drop bad comment in nfs41_walk_client_list() Kinglong Mee
2015-07-01  3:59 ` [PATCH 7/8] nfs: Remove invalid NFS_ATTR_FATTR_V4_REFERRAL checking in nfs4_get_rootfh Kinglong Mee
2015-07-01  4:00 ` [PATCH 8/8] nfs: Remove invalid tk_pid from debug message Kinglong Mee

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=5594008D.8080909@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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