aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c75
1 files changed, 50 insertions, 25 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index d9cf467309e8..974c8f0e615e 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -66,7 +66,9 @@ unsigned int sign_CIFS_PDUs = 1;
66extern struct task_struct *oplockThread; /* remove sparse warning */ 66extern struct task_struct *oplockThread; /* remove sparse warning */
67struct task_struct *oplockThread = NULL; 67struct task_struct *oplockThread = NULL;
68/* extern struct task_struct * dnotifyThread; remove sparse warning */ 68/* extern struct task_struct * dnotifyThread; remove sparse warning */
69#ifdef CONFIG_CIFS_EXPERIMENTAL
69static struct task_struct *dnotifyThread = NULL; 70static struct task_struct *dnotifyThread = NULL;
71#endif
70static const struct super_operations cifs_super_ops; 72static const struct super_operations cifs_super_ops;
71unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; 73unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
72module_param(CIFSMaxBufSize, int, 0); 74module_param(CIFSMaxBufSize, int, 0);
@@ -337,39 +339,58 @@ static int
337cifs_show_options(struct seq_file *s, struct vfsmount *m) 339cifs_show_options(struct seq_file *s, struct vfsmount *m)
338{ 340{
339 struct cifs_sb_info *cifs_sb; 341 struct cifs_sb_info *cifs_sb;
342 struct cifsTconInfo *tcon;
343 struct TCP_Server_Info *server;
340 344
341 cifs_sb = CIFS_SB(m->mnt_sb); 345 cifs_sb = CIFS_SB(m->mnt_sb);
342 346
343 if (cifs_sb) { 347 if (cifs_sb) {
344 if (cifs_sb->tcon) { 348 tcon = cifs_sb->tcon;
345/* BB add prepath to mount options displayed */ 349 if (tcon) {
346 seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); 350 seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName);
347 if (cifs_sb->tcon->ses) { 351 if (tcon->ses) {
348 if (cifs_sb->tcon->ses->userName) 352 if (tcon->ses->userName)
349 seq_printf(s, ",username=%s", 353 seq_printf(s, ",username=%s",
350 cifs_sb->tcon->ses->userName); 354 tcon->ses->userName);
351 if (cifs_sb->tcon->ses->domainName) 355 if (tcon->ses->domainName)
352 seq_printf(s, ",domain=%s", 356 seq_printf(s, ",domain=%s",
353 cifs_sb->tcon->ses->domainName); 357 tcon->ses->domainName);
358 server = tcon->ses->server;
359 if (server) {
360 seq_printf(s, ",addr=");
361 switch (server->addr.sockAddr6.
362 sin6_family) {
363 case AF_INET6:
364 seq_printf(s, NIP6_FMT,
365 NIP6(server->addr.sockAddr6.sin6_addr));
366 break;
367 case AF_INET:
368 seq_printf(s, NIPQUAD_FMT,
369 NIPQUAD(server->addr.sockAddr.sin_addr.s_addr));
370 break;
371 }
372 }
354 } 373 }
355 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) || 374 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) ||
356 !(cifs_sb->tcon->unix_ext)) 375 !(tcon->unix_ext))
357 seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); 376 seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
358 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) || 377 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) ||
359 !(cifs_sb->tcon->unix_ext)) 378 !(tcon->unix_ext))
360 seq_printf(s, ",gid=%d", cifs_sb->mnt_gid); 379 seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
361 if (!cifs_sb->tcon->unix_ext) { 380 if (!tcon->unix_ext) {
362 seq_printf(s, ",file_mode=0%o,dir_mode=0%o", 381 seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
363 cifs_sb->mnt_file_mode, 382 cifs_sb->mnt_file_mode,
364 cifs_sb->mnt_dir_mode); 383 cifs_sb->mnt_dir_mode);
365 } 384 }
366 if (cifs_sb->tcon->seal) 385 if (tcon->seal)
367 seq_printf(s, ",seal"); 386 seq_printf(s, ",seal");
368 if (cifs_sb->tcon->nocase) 387 if (tcon->nocase)
369 seq_printf(s, ",nocase"); 388 seq_printf(s, ",nocase");
370 if (cifs_sb->tcon->retry) 389 if (tcon->retry)
371 seq_printf(s, ",hard"); 390 seq_printf(s, ",hard");
372 } 391 }
392 if (cifs_sb->prepath)
393 seq_printf(s, ",prepath=%s", cifs_sb->prepath);
373 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) 394 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
374 seq_printf(s, ",posixpaths"); 395 seq_printf(s, ",posixpaths");
375 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) 396 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)
@@ -417,9 +438,8 @@ int cifs_xquota_set(struct super_block *sb, int quota_type, qid_t qid,
417 xid = GetXid(); 438 xid = GetXid();
418 if (pTcon) { 439 if (pTcon) {
419 cFYI(1, ("set type: 0x%x id: %d", quota_type, qid)); 440 cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
420 } else { 441 } else
421 rc = -EIO; 442 rc = -EIO;
422 }
423 443
424 FreeXid(xid); 444 FreeXid(xid);
425 return rc; 445 return rc;
@@ -441,9 +461,8 @@ int cifs_xquota_get(struct super_block *sb, int quota_type, qid_t qid,
441 xid = GetXid(); 461 xid = GetXid();
442 if (pTcon) { 462 if (pTcon) {
443 cFYI(1, ("set type: 0x%x id: %d", quota_type, qid)); 463 cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
444 } else { 464 } else
445 rc = -EIO; 465 rc = -EIO;
446 }
447 466
448 FreeXid(xid); 467 FreeXid(xid);
449 return rc; 468 return rc;
@@ -464,9 +483,8 @@ int cifs_xstate_set(struct super_block *sb, unsigned int flags, int operation)
464 xid = GetXid(); 483 xid = GetXid();
465 if (pTcon) { 484 if (pTcon) {
466 cFYI(1, ("flags: 0x%x operation: 0x%x", flags, operation)); 485 cFYI(1, ("flags: 0x%x operation: 0x%x", flags, operation));
467 } else { 486 } else
468 rc = -EIO; 487 rc = -EIO;
469 }
470 488
471 FreeXid(xid); 489 FreeXid(xid);
472 return rc; 490 return rc;
@@ -479,17 +497,16 @@ int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats)
479 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 497 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
480 struct cifsTconInfo *pTcon; 498 struct cifsTconInfo *pTcon;
481 499
482 if (cifs_sb) { 500 if (cifs_sb)
483 pTcon = cifs_sb->tcon; 501 pTcon = cifs_sb->tcon;
484 } else { 502 else
485 return -EIO; 503 return -EIO;
486 } 504
487 xid = GetXid(); 505 xid = GetXid();
488 if (pTcon) { 506 if (pTcon) {
489 cFYI(1, ("pqstats %p", qstats)); 507 cFYI(1, ("pqstats %p", qstats));
490 } else { 508 } else
491 rc = -EIO; 509 rc = -EIO;
492 }
493 510
494 FreeXid(xid); 511 FreeXid(xid);
495 return rc; 512 return rc;
@@ -1029,6 +1046,7 @@ static int cifs_oplock_thread(void *dummyarg)
1029 return 0; 1046 return 0;
1030} 1047}
1031 1048
1049#ifdef CONFIG_CIFS_EXPERIMENTAL
1032static int cifs_dnotify_thread(void *dummyarg) 1050static int cifs_dnotify_thread(void *dummyarg)
1033{ 1051{
1034 struct list_head *tmp; 1052 struct list_head *tmp;
@@ -1054,6 +1072,7 @@ static int cifs_dnotify_thread(void *dummyarg)
1054 1072
1055 return 0; 1073 return 0;
1056} 1074}
1075#endif
1057 1076
1058static int __init 1077static int __init
1059init_cifs(void) 1078init_cifs(void)
@@ -1131,16 +1150,20 @@ init_cifs(void)
1131 goto out_unregister_dfs_key_type; 1150 goto out_unregister_dfs_key_type;
1132 } 1151 }
1133 1152
1153#ifdef CONFIG_CIFS_EXPERIMENTAL
1134 dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); 1154 dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
1135 if (IS_ERR(dnotifyThread)) { 1155 if (IS_ERR(dnotifyThread)) {
1136 rc = PTR_ERR(dnotifyThread); 1156 rc = PTR_ERR(dnotifyThread);
1137 cERROR(1, ("error %d create dnotify thread", rc)); 1157 cERROR(1, ("error %d create dnotify thread", rc));
1138 goto out_stop_oplock_thread; 1158 goto out_stop_oplock_thread;
1139 } 1159 }
1160#endif
1140 1161
1141 return 0; 1162 return 0;
1142 1163
1164#ifdef CONFIG_CIFS_EXPERIMENTAL
1143 out_stop_oplock_thread: 1165 out_stop_oplock_thread:
1166#endif
1144 kthread_stop(oplockThread); 1167 kthread_stop(oplockThread);
1145 out_unregister_dfs_key_type: 1168 out_unregister_dfs_key_type:
1146#ifdef CONFIG_CIFS_DFS_UPCALL 1169#ifdef CONFIG_CIFS_DFS_UPCALL
@@ -1179,8 +1202,10 @@ exit_cifs(void)
1179 cifs_destroy_inodecache(); 1202 cifs_destroy_inodecache();
1180 cifs_destroy_mids(); 1203 cifs_destroy_mids();
1181 cifs_destroy_request_bufs(); 1204 cifs_destroy_request_bufs();
1182 kthread_stop(oplockThread); 1205#ifdef CONFIG_CIFS_EXPERIMENTAL
1183 kthread_stop(dnotifyThread); 1206 kthread_stop(dnotifyThread);
1207#endif
1208 kthread_stop(oplockThread);
1184} 1209}
1185 1210
1186MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); 1211MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");