aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-08-22 20:06:12 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:36 -0400
commitcf6d7b5de8535a9f0088c5cc28ee2dae87371b4a (patch)
tree815aecb371fc5b702c209bbda550e950e2bd1b04
parent5006a76cca8f86c6975c16fcf67e83b8b0eee2b6 (diff)
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: David Howells <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/super.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 85583414a3ca..5842d510d732 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -722,18 +722,15 @@ static int nfs_clone_generic_sb(struct nfs_clone_mount *data,
722 if (server->hostname == NULL) 722 if (server->hostname == NULL)
723 goto free_server; 723 goto free_server;
724 memcpy(server->hostname, hostname, len); 724 memcpy(server->hostname, hostname, len);
725 error = rpciod_up();
726 if (error != 0)
727 goto free_hostname;
728 725
729 sb = fill_sb(server, data); 726 sb = fill_sb(server, data);
730 if (IS_ERR(sb)) { 727 if (IS_ERR(sb)) {
731 error = PTR_ERR(sb); 728 error = PTR_ERR(sb);
732 goto kill_rpciod; 729 goto free_hostname;
733 } 730 }
734 731
735 if (sb->s_root) 732 if (sb->s_root)
736 goto out_rpciod_down; 733 goto out_share;
737 734
738 server = fill_server(sb, data); 735 server = fill_server(sb, data);
739 if (IS_ERR(server)) { 736 if (IS_ERR(server)) {
@@ -745,14 +742,11 @@ out_deactivate:
745 up_write(&sb->s_umount); 742 up_write(&sb->s_umount);
746 deactivate_super(sb); 743 deactivate_super(sb);
747 return error; 744 return error;
748out_rpciod_down: 745out_share:
749 rpciod_down();
750 kfree(server->hostname); 746 kfree(server->hostname);
751 nfs_put_client(server->nfs_client); 747 nfs_put_client(server->nfs_client);
752 kfree(server); 748 kfree(server);
753 return simple_set_mnt(mnt, sb); 749 return simple_set_mnt(mnt, sb);
754kill_rpciod:
755 rpciod_down();
756free_hostname: 750free_hostname:
757 kfree(server->hostname); 751 kfree(server->hostname);
758free_server: 752free_server:
@@ -939,22 +933,14 @@ static int nfs_get_sb(struct file_system_type *fs_type,
939 goto out_err; 933 goto out_err;
940 } 934 }
941 935
942 /* Fire up rpciod if not yet running */
943 error = rpciod_up();
944 if (error < 0) {
945 dprintk("%s: couldn't start rpciod! Error = %d\n",
946 __FUNCTION__, error);
947 goto out_err;
948 }
949
950 s = sget(fs_type, nfs_compare_super, nfs_set_super, server); 936 s = sget(fs_type, nfs_compare_super, nfs_set_super, server);
951 if (IS_ERR(s)) { 937 if (IS_ERR(s)) {
952 error = PTR_ERR(s); 938 error = PTR_ERR(s);
953 goto out_err_rpciod; 939 goto out_err;
954 } 940 }
955 941
956 if (s->s_root) 942 if (s->s_root)
957 goto out_rpciod_down; 943 goto out_share;
958 944
959 s->s_flags = flags; 945 s->s_flags = flags;
960 946
@@ -967,13 +953,10 @@ static int nfs_get_sb(struct file_system_type *fs_type,
967 s->s_flags |= MS_ACTIVE; 953 s->s_flags |= MS_ACTIVE;
968 return simple_set_mnt(mnt, s); 954 return simple_set_mnt(mnt, s);
969 955
970out_rpciod_down: 956out_share:
971 rpciod_down();
972 kfree(server); 957 kfree(server);
973 return simple_set_mnt(mnt, s); 958 return simple_set_mnt(mnt, s);
974 959
975out_err_rpciod:
976 rpciod_down();
977out_err: 960out_err:
978 kfree(server); 961 kfree(server);
979out_err_noserver: 962out_err_noserver:
@@ -994,8 +977,6 @@ static void nfs_kill_super(struct super_block *s)
994 if (!(server->flags & NFS_MOUNT_NONLM)) 977 if (!(server->flags & NFS_MOUNT_NONLM))
995 lockd_down(); /* release rpc.lockd */ 978 lockd_down(); /* release rpc.lockd */
996 979
997 rpciod_down(); /* release rpciod */
998
999 nfs_free_iostats(server->io_stats); 980 nfs_free_iostats(server->io_stats);
1000 kfree(server->hostname); 981 kfree(server->hostname);
1001 nfs_put_client(server->nfs_client); 982 nfs_put_client(server->nfs_client);