Commit cf6d7b5d authored by David Howells's avatar David Howells Committed by Trond Myklebust

NFS: Start rpciod in server common management

Start rpciod in the server common (nfs_client struct) management code rather
than in the superblock management code.  This means we only need to "start" it
once per server instead of once per superblock.
Signed-Off-By: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 5006a76c
...@@ -722,18 +722,15 @@ static int nfs_clone_generic_sb(struct nfs_clone_mount *data, ...@@ -722,18 +722,15 @@ static int nfs_clone_generic_sb(struct nfs_clone_mount *data,
if (server->hostname == NULL) if (server->hostname == NULL)
goto free_server; goto free_server;
memcpy(server->hostname, hostname, len); memcpy(server->hostname, hostname, len);
error = rpciod_up();
if (error != 0)
goto free_hostname;
sb = fill_sb(server, data); sb = fill_sb(server, data);
if (IS_ERR(sb)) { if (IS_ERR(sb)) {
error = PTR_ERR(sb); error = PTR_ERR(sb);
goto kill_rpciod; goto free_hostname;
} }
if (sb->s_root) if (sb->s_root)
goto out_rpciod_down; goto out_share;
server = fill_server(sb, data); server = fill_server(sb, data);
if (IS_ERR(server)) { if (IS_ERR(server)) {
...@@ -745,14 +742,11 @@ static int nfs_clone_generic_sb(struct nfs_clone_mount *data, ...@@ -745,14 +742,11 @@ static int nfs_clone_generic_sb(struct nfs_clone_mount *data,
up_write(&sb->s_umount); up_write(&sb->s_umount);
deactivate_super(sb); deactivate_super(sb);
return error; return error;
out_rpciod_down: out_share:
rpciod_down();
kfree(server->hostname); kfree(server->hostname);
nfs_put_client(server->nfs_client); nfs_put_client(server->nfs_client);
kfree(server); kfree(server);
return simple_set_mnt(mnt, sb); return simple_set_mnt(mnt, sb);
kill_rpciod:
rpciod_down();
free_hostname: free_hostname:
kfree(server->hostname); kfree(server->hostname);
free_server: free_server:
...@@ -939,22 +933,14 @@ static int nfs_get_sb(struct file_system_type *fs_type, ...@@ -939,22 +933,14 @@ static int nfs_get_sb(struct file_system_type *fs_type,
goto out_err; goto out_err;
} }
/* Fire up rpciod if not yet running */
error = rpciod_up();
if (error < 0) {
dprintk("%s: couldn't start rpciod! Error = %d\n",
__FUNCTION__, error);
goto out_err;
}
s = sget(fs_type, nfs_compare_super, nfs_set_super, server); s = sget(fs_type, nfs_compare_super, nfs_set_super, server);
if (IS_ERR(s)) { if (IS_ERR(s)) {
error = PTR_ERR(s); error = PTR_ERR(s);
goto out_err_rpciod; goto out_err;
} }
if (s->s_root) if (s->s_root)
goto out_rpciod_down; goto out_share;
s->s_flags = flags; s->s_flags = flags;
...@@ -967,13 +953,10 @@ static int nfs_get_sb(struct file_system_type *fs_type, ...@@ -967,13 +953,10 @@ static int nfs_get_sb(struct file_system_type *fs_type,
s->s_flags |= MS_ACTIVE; s->s_flags |= MS_ACTIVE;
return simple_set_mnt(mnt, s); return simple_set_mnt(mnt, s);
out_rpciod_down: out_share:
rpciod_down();
kfree(server); kfree(server);
return simple_set_mnt(mnt, s); return simple_set_mnt(mnt, s);
out_err_rpciod:
rpciod_down();
out_err: out_err:
kfree(server); kfree(server);
out_err_noserver: out_err_noserver:
...@@ -994,8 +977,6 @@ static void nfs_kill_super(struct super_block *s) ...@@ -994,8 +977,6 @@ static void nfs_kill_super(struct super_block *s)
if (!(server->flags & NFS_MOUNT_NONLM)) if (!(server->flags & NFS_MOUNT_NONLM))
lockd_down(); /* release rpc.lockd */ lockd_down(); /* release rpc.lockd */
rpciod_down(); /* release rpciod */
nfs_free_iostats(server->io_stats); nfs_free_iostats(server->io_stats);
kfree(server->hostname); kfree(server->hostname);
nfs_put_client(server->nfs_client); nfs_put_client(server->nfs_client);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment