diff options
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index b1fd382d195..541ef81f6ae 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 | ||
@@ -378,13 +370,13 @@ cifs_show_options(struct seq_file *s, struct dentry *root) | |||
378 | (int)(srcaddr->sa_family)); | 370 | (int)(srcaddr->sa_family)); |
379 | } | 371 | } |
380 | 372 | ||
381 | seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); | 373 | seq_printf(s, ",uid=%u", cifs_sb->mnt_uid); |
382 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) | 374 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) |
383 | seq_printf(s, ",forceuid"); | 375 | seq_printf(s, ",forceuid"); |
384 | else | 376 | else |
385 | seq_printf(s, ",noforceuid"); | 377 | seq_printf(s, ",noforceuid"); |
386 | 378 | ||
387 | seq_printf(s, ",gid=%d", cifs_sb->mnt_gid); | 379 | seq_printf(s, ",gid=%u", cifs_sb->mnt_gid); |
388 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) | 380 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) |
389 | seq_printf(s, ",forcegid"); | 381 | seq_printf(s, ",forcegid"); |
390 | else | 382 | else |
@@ -442,11 +434,15 @@ cifs_show_options(struct seq_file *s, struct dentry *root) | |||
442 | seq_printf(s, ",noperm"); | 434 | seq_printf(s, ",noperm"); |
443 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) | 435 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) |
444 | seq_printf(s, ",strictcache"); | 436 | seq_printf(s, ",strictcache"); |
437 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID) | ||
438 | seq_printf(s, ",backupuid=%u", cifs_sb->mnt_backupuid); | ||
439 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPGID) | ||
440 | seq_printf(s, ",backupgid=%u", cifs_sb->mnt_backupgid); | ||
445 | 441 | ||
446 | seq_printf(s, ",rsize=%d", cifs_sb->rsize); | 442 | seq_printf(s, ",rsize=%u", cifs_sb->rsize); |
447 | seq_printf(s, ",wsize=%d", cifs_sb->wsize); | 443 | seq_printf(s, ",wsize=%u", cifs_sb->wsize); |
448 | /* convert actimeo and display it in seconds */ | 444 | /* convert actimeo and display it in seconds */ |
449 | seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ); | 445 | seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ); |
450 | 446 | ||
451 | return 0; | 447 | return 0; |
452 | } | 448 | } |
@@ -703,7 +699,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin) | |||
703 | * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate | 699 | * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate |
704 | * the cached file length | 700 | * the cached file length |
705 | */ | 701 | */ |
706 | if (origin != SEEK_SET || origin != SEEK_CUR) { | 702 | if (origin != SEEK_SET && origin != SEEK_CUR) { |
707 | int rc; | 703 | int rc; |
708 | struct inode *inode = file->f_path.dentry->d_inode; | 704 | struct inode *inode = file->f_path.dentry->d_inode; |
709 | 705 | ||
@@ -1116,14 +1112,20 @@ init_cifs(void) | |||
1116 | if (cifs_max_pending < 2) { | 1112 | if (cifs_max_pending < 2) { |
1117 | cifs_max_pending = 2; | 1113 | cifs_max_pending = 2; |
1118 | cFYI(1, "cifs_max_pending set to min of 2"); | 1114 | cFYI(1, "cifs_max_pending set to min of 2"); |
1119 | } else if (cifs_max_pending > 256) { | 1115 | } else if (cifs_max_pending > CIFS_MAX_REQ) { |
1120 | cifs_max_pending = 256; | 1116 | cifs_max_pending = CIFS_MAX_REQ; |
1121 | cFYI(1, "cifs_max_pending set to max of 256"); | 1117 | cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ); |
1118 | } | ||
1119 | |||
1120 | cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); | ||
1121 | if (!cifsiod_wq) { | ||
1122 | rc = -ENOMEM; | ||
1123 | goto out_clean_proc; | ||
1122 | } | 1124 | } |
1123 | 1125 | ||
1124 | rc = cifs_fscache_register(); | 1126 | rc = cifs_fscache_register(); |
1125 | if (rc) | 1127 | if (rc) |
1126 | goto out_clean_proc; | 1128 | goto out_destroy_wq; |
1127 | 1129 | ||
1128 | rc = cifs_init_inodecache(); | 1130 | rc = cifs_init_inodecache(); |
1129 | if (rc) | 1131 | if (rc) |
@@ -1171,6 +1173,8 @@ out_destroy_inodecache: | |||
1171 | cifs_destroy_inodecache(); | 1173 | cifs_destroy_inodecache(); |
1172 | out_unreg_fscache: | 1174 | out_unreg_fscache: |
1173 | cifs_fscache_unregister(); | 1175 | cifs_fscache_unregister(); |
1176 | out_destroy_wq: | ||
1177 | destroy_workqueue(cifsiod_wq); | ||
1174 | out_clean_proc: | 1178 | out_clean_proc: |
1175 | cifs_proc_clean(); | 1179 | cifs_proc_clean(); |
1176 | return rc; | 1180 | return rc; |
@@ -1180,11 +1184,8 @@ static void __exit | |||
1180 | exit_cifs(void) | 1184 | exit_cifs(void) |
1181 | { | 1185 | { |
1182 | cFYI(DBG2, "exit_cifs"); | 1186 | cFYI(DBG2, "exit_cifs"); |
1183 | cifs_proc_clean(); | 1187 | unregister_filesystem(&cifs_fs_type); |
1184 | cifs_fscache_unregister(); | ||
1185 | #ifdef CONFIG_CIFS_DFS_UPCALL | ||
1186 | cifs_dfs_release_automount_timer(); | 1188 | cifs_dfs_release_automount_timer(); |
1187 | #endif | ||
1188 | #ifdef CONFIG_CIFS_ACL | 1189 | #ifdef CONFIG_CIFS_ACL |
1189 | cifs_destroy_idmaptrees(); | 1190 | cifs_destroy_idmaptrees(); |
1190 | exit_cifs_idmap(); | 1191 | exit_cifs_idmap(); |
@@ -1192,10 +1193,12 @@ exit_cifs(void) | |||
1192 | #ifdef CONFIG_CIFS_UPCALL | 1193 | #ifdef CONFIG_CIFS_UPCALL |
1193 | unregister_key_type(&cifs_spnego_key_type); | 1194 | unregister_key_type(&cifs_spnego_key_type); |
1194 | #endif | 1195 | #endif |
1195 | unregister_filesystem(&cifs_fs_type); | ||
1196 | cifs_destroy_inodecache(); | ||
1197 | cifs_destroy_mids(); | ||
1198 | cifs_destroy_request_bufs(); | 1196 | cifs_destroy_request_bufs(); |
1197 | cifs_destroy_mids(); | ||
1198 | cifs_destroy_inodecache(); | ||
1199 | cifs_fscache_unregister(); | ||
1200 | destroy_workqueue(cifsiod_wq); | ||
1201 | cifs_proc_clean(); | ||
1199 | } | 1202 | } |
1200 | 1203 | ||
1201 | MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); | 1204 | MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); |