diff options
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index b1fd382d1952..d34212822444 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -76,12 +76,7 @@ MODULE_PARM_DESC(cifs_min_small, "Small network buffers in pool. Default: 30 " | |||
76 | unsigned int cifs_max_pending = CIFS_MAX_REQ; | 76 | unsigned int cifs_max_pending = CIFS_MAX_REQ; |
77 | module_param(cifs_max_pending, int, 0444); | 77 | module_param(cifs_max_pending, int, 0444); |
78 | MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. " | 78 | MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. " |
79 | "Default: 50 Range: 2 to 256"); | 79 | "Default: 32767 Range: 2 to 32767."); |
80 | unsigned short echo_retries = 5; | ||
81 | module_param(echo_retries, ushort, 0644); | ||
82 | MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and " | ||
83 | "reconnecting server. Default: 5. 0 means " | ||
84 | "never reconnect."); | ||
85 | module_param(enable_oplocks, bool, 0644); | 80 | module_param(enable_oplocks, bool, 0644); |
86 | MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks (bool). Default:" | 81 | MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks (bool). Default:" |
87 | "y/Y/1"); | 82 | "y/Y/1"); |
@@ -90,6 +85,8 @@ extern mempool_t *cifs_sm_req_poolp; | |||
90 | extern mempool_t *cifs_req_poolp; | 85 | extern mempool_t *cifs_req_poolp; |
91 | extern mempool_t *cifs_mid_poolp; | 86 | extern mempool_t *cifs_mid_poolp; |
92 | 87 | ||
88 | struct workqueue_struct *cifsiod_wq; | ||
89 | |||
93 | static int | 90 | static int |
94 | cifs_read_super(struct super_block *sb) | 91 | cifs_read_super(struct super_block *sb) |
95 | { | 92 | { |
@@ -119,12 +116,10 @@ cifs_read_super(struct super_block *sb) | |||
119 | 116 | ||
120 | if (IS_ERR(inode)) { | 117 | if (IS_ERR(inode)) { |
121 | rc = PTR_ERR(inode); | 118 | rc = PTR_ERR(inode); |
122 | inode = NULL; | ||
123 | goto out_no_root; | 119 | goto out_no_root; |
124 | } | 120 | } |
125 | 121 | ||
126 | sb->s_root = d_alloc_root(inode); | 122 | sb->s_root = d_make_root(inode); |
127 | |||
128 | if (!sb->s_root) { | 123 | if (!sb->s_root) { |
129 | rc = -ENOMEM; | 124 | rc = -ENOMEM; |
130 | goto out_no_root; | 125 | goto out_no_root; |
@@ -147,9 +142,6 @@ cifs_read_super(struct super_block *sb) | |||
147 | 142 | ||
148 | out_no_root: | 143 | out_no_root: |
149 | cERROR(1, "cifs_read_super: get root inode failed"); | 144 | cERROR(1, "cifs_read_super: get root inode failed"); |
150 | if (inode) | ||
151 | iput(inode); | ||
152 | |||
153 | return rc; | 145 | return rc; |
154 | } | 146 | } |
155 | 147 | ||
@@ -1116,14 +1108,20 @@ init_cifs(void) | |||
1116 | if (cifs_max_pending < 2) { | 1108 | if (cifs_max_pending < 2) { |
1117 | cifs_max_pending = 2; | 1109 | cifs_max_pending = 2; |
1118 | cFYI(1, "cifs_max_pending set to min of 2"); | 1110 | cFYI(1, "cifs_max_pending set to min of 2"); |
1119 | } else if (cifs_max_pending > 256) { | 1111 | } else if (cifs_max_pending > CIFS_MAX_REQ) { |
1120 | cifs_max_pending = 256; | 1112 | cifs_max_pending = CIFS_MAX_REQ; |
1121 | cFYI(1, "cifs_max_pending set to max of 256"); | 1113 | cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ); |
1114 | } | ||
1115 | |||
1116 | cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); | ||
1117 | if (!cifsiod_wq) { | ||
1118 | rc = -ENOMEM; | ||
1119 | goto out_clean_proc; | ||
1122 | } | 1120 | } |
1123 | 1121 | ||
1124 | rc = cifs_fscache_register(); | 1122 | rc = cifs_fscache_register(); |
1125 | if (rc) | 1123 | if (rc) |
1126 | goto out_clean_proc; | 1124 | goto out_destroy_wq; |
1127 | 1125 | ||
1128 | rc = cifs_init_inodecache(); | 1126 | rc = cifs_init_inodecache(); |
1129 | if (rc) | 1127 | if (rc) |
@@ -1171,6 +1169,8 @@ out_destroy_inodecache: | |||
1171 | cifs_destroy_inodecache(); | 1169 | cifs_destroy_inodecache(); |
1172 | out_unreg_fscache: | 1170 | out_unreg_fscache: |
1173 | cifs_fscache_unregister(); | 1171 | cifs_fscache_unregister(); |
1172 | out_destroy_wq: | ||
1173 | destroy_workqueue(cifsiod_wq); | ||
1174 | out_clean_proc: | 1174 | out_clean_proc: |
1175 | cifs_proc_clean(); | 1175 | cifs_proc_clean(); |
1176 | return rc; | 1176 | return rc; |
@@ -1180,11 +1180,8 @@ static void __exit | |||
1180 | exit_cifs(void) | 1180 | exit_cifs(void) |
1181 | { | 1181 | { |
1182 | cFYI(DBG2, "exit_cifs"); | 1182 | cFYI(DBG2, "exit_cifs"); |
1183 | cifs_proc_clean(); | 1183 | unregister_filesystem(&cifs_fs_type); |
1184 | cifs_fscache_unregister(); | ||
1185 | #ifdef CONFIG_CIFS_DFS_UPCALL | ||
1186 | cifs_dfs_release_automount_timer(); | 1184 | cifs_dfs_release_automount_timer(); |
1187 | #endif | ||
1188 | #ifdef CONFIG_CIFS_ACL | 1185 | #ifdef CONFIG_CIFS_ACL |
1189 | cifs_destroy_idmaptrees(); | 1186 | cifs_destroy_idmaptrees(); |
1190 | exit_cifs_idmap(); | 1187 | exit_cifs_idmap(); |
@@ -1192,10 +1189,12 @@ exit_cifs(void) | |||
1192 | #ifdef CONFIG_CIFS_UPCALL | 1189 | #ifdef CONFIG_CIFS_UPCALL |
1193 | unregister_key_type(&cifs_spnego_key_type); | 1190 | unregister_key_type(&cifs_spnego_key_type); |
1194 | #endif | 1191 | #endif |
1195 | unregister_filesystem(&cifs_fs_type); | ||
1196 | cifs_destroy_inodecache(); | ||
1197 | cifs_destroy_mids(); | ||
1198 | cifs_destroy_request_bufs(); | 1192 | cifs_destroy_request_bufs(); |
1193 | cifs_destroy_mids(); | ||
1194 | cifs_destroy_inodecache(); | ||
1195 | cifs_fscache_unregister(); | ||
1196 | destroy_workqueue(cifsiod_wq); | ||
1197 | cifs_proc_clean(); | ||
1199 | } | 1198 | } |
1200 | 1199 | ||
1201 | MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); | 1200 | MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); |