mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
nfs: Use remove_proc_subtree() instead remove_proc_entry()
Thanks for Al Viro's comments of killing proc_fs_nfs completely. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
71f81e51ee
commit
6a062a3687
@ -1192,8 +1192,6 @@ void nfs_clients_init(struct net *net)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PROC_FS
|
#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 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_start(struct seq_file *p, loff_t *pos);
|
||||||
static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);
|
static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);
|
||||||
@ -1435,27 +1433,20 @@ void nfs_fs_proc_net_exit(struct net *net)
|
|||||||
*/
|
*/
|
||||||
int __init nfs_fs_proc_init(void)
|
int __init nfs_fs_proc_init(void)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *p;
|
if (!proc_mkdir("fs/nfsfs", NULL))
|
||||||
|
|
||||||
proc_fs_nfs = proc_mkdir("fs/nfsfs", NULL);
|
|
||||||
if (!proc_fs_nfs)
|
|
||||||
goto error_0;
|
goto error_0;
|
||||||
|
|
||||||
/* a file of servers with which we're dealing */
|
/* a file of servers with which we're dealing */
|
||||||
p = proc_symlink("servers", proc_fs_nfs, "../../net/nfsfs/servers");
|
if (!proc_symlink("fs/nfsfs/servers", NULL, "../../net/nfsfs/servers"))
|
||||||
if (!p)
|
|
||||||
goto error_1;
|
goto error_1;
|
||||||
|
|
||||||
/* a file of volumes that we have mounted */
|
/* a file of volumes that we have mounted */
|
||||||
p = proc_symlink("volumes", proc_fs_nfs, "../../net/nfsfs/volumes");
|
if (!proc_symlink("fs/nfsfs/volumes", NULL, "../../net/nfsfs/volumes"))
|
||||||
if (!p)
|
goto error_1;
|
||||||
goto error_2;
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
error_2:
|
return 0;
|
||||||
remove_proc_entry("servers", proc_fs_nfs);
|
|
||||||
error_1:
|
error_1:
|
||||||
remove_proc_entry("fs/nfsfs", NULL);
|
remove_proc_subtree("fs/nfsfs", NULL);
|
||||||
error_0:
|
error_0:
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@ -1465,9 +1456,7 @@ error_0:
|
|||||||
*/
|
*/
|
||||||
void nfs_fs_proc_exit(void)
|
void nfs_fs_proc_exit(void)
|
||||||
{
|
{
|
||||||
remove_proc_entry("volumes", proc_fs_nfs);
|
remove_proc_subtree("fs/nfsfs", NULL);
|
||||||
remove_proc_entry("servers", proc_fs_nfs);
|
|
||||||
remove_proc_entry("fs/nfsfs", NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
|
Loading…
Reference in New Issue
Block a user