aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2010-10-07 23:42:03 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-07 23:42:03 -0400
commit6ea75952d7c671ea8b0d7b66f82afcafbb5d20c2 (patch)
tree66cf5e73830d2730866f7e6bf6cf93f0684c5b99 /fs/cifs/cifsfs.c
parent6b0cd00bc396daf5c2dcf17a8d82055335341f46 (diff)
parentd2445556137c38ae15d3191174bfd235630ed7cd (diff)
Merge branch 'for-next'
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c61
1 files changed, 41 insertions, 20 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index b7431afdd76d..c96345c3314d 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -36,6 +36,7 @@
36#include <linux/kthread.h> 36#include <linux/kthread.h>
37#include <linux/freezer.h> 37#include <linux/freezer.h>
38#include <linux/smp_lock.h> 38#include <linux/smp_lock.h>
39#include <net/ipv6.h>
39#include "cifsfs.h" 40#include "cifsfs.h"
40#include "cifspdu.h" 41#include "cifspdu.h"
41#define DECLARE_GLOBALS_HERE 42#define DECLARE_GLOBALS_HERE
@@ -136,9 +137,6 @@ cifs_read_super(struct super_block *sb, void *data,
136 sb->s_magic = CIFS_MAGIC_NUMBER; 137 sb->s_magic = CIFS_MAGIC_NUMBER;
137 sb->s_op = &cifs_super_ops; 138 sb->s_op = &cifs_super_ops;
138 sb->s_bdi = &cifs_sb->bdi; 139 sb->s_bdi = &cifs_sb->bdi;
139/* if (cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512)
140 sb->s_blocksize =
141 cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */
142 sb->s_blocksize = CIFS_MAX_MSGSIZE; 140 sb->s_blocksize = CIFS_MAX_MSGSIZE;
143 sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */ 141 sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */
144 inode = cifs_root_iget(sb, ROOT_I); 142 inode = cifs_root_iget(sb, ROOT_I);
@@ -224,7 +222,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
224{ 222{
225 struct super_block *sb = dentry->d_sb; 223 struct super_block *sb = dentry->d_sb;
226 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 224 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
227 struct cifsTconInfo *tcon = cifs_sb->tcon; 225 struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb);
228 int rc = -EOPNOTSUPP; 226 int rc = -EOPNOTSUPP;
229 int xid; 227 int xid;
230 228
@@ -366,14 +364,36 @@ static int
366cifs_show_options(struct seq_file *s, struct vfsmount *m) 364cifs_show_options(struct seq_file *s, struct vfsmount *m)
367{ 365{
368 struct cifs_sb_info *cifs_sb = CIFS_SB(m->mnt_sb); 366 struct cifs_sb_info *cifs_sb = CIFS_SB(m->mnt_sb);
369 struct cifsTconInfo *tcon = cifs_sb->tcon; 367 struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb);
368 struct sockaddr *srcaddr;
369 srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr;
370 370
371 seq_printf(s, ",unc=%s", tcon->treeName); 371 seq_printf(s, ",unc=%s", tcon->treeName);
372 if (tcon->ses->userName) 372
373 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)
374 seq_printf(s, ",multiuser");
375 else if (tcon->ses->userName)
373 seq_printf(s, ",username=%s", tcon->ses->userName); 376 seq_printf(s, ",username=%s", tcon->ses->userName);
377
374 if (tcon->ses->domainName) 378 if (tcon->ses->domainName)
375 seq_printf(s, ",domain=%s", tcon->ses->domainName); 379 seq_printf(s, ",domain=%s", tcon->ses->domainName);
376 380
381 if (srcaddr->sa_family != AF_UNSPEC) {
382 struct sockaddr_in *saddr4;
383 struct sockaddr_in6 *saddr6;
384 saddr4 = (struct sockaddr_in *)srcaddr;
385 saddr6 = (struct sockaddr_in6 *)srcaddr;
386 if (srcaddr->sa_family == AF_INET6)
387 seq_printf(s, ",srcaddr=%pI6c",
388 &saddr6->sin6_addr);
389 else if (srcaddr->sa_family == AF_INET)
390 seq_printf(s, ",srcaddr=%pI4",
391 &saddr4->sin_addr.s_addr);
392 else
393 seq_printf(s, ",srcaddr=BAD-AF:%i",
394 (int)(srcaddr->sa_family));
395 }
396
377 seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); 397 seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
378 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) 398 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)
379 seq_printf(s, ",forceuid"); 399 seq_printf(s, ",forceuid");
@@ -422,6 +442,8 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
422 seq_printf(s, ",dynperm"); 442 seq_printf(s, ",dynperm");
423 if (m->mnt_sb->s_flags & MS_POSIXACL) 443 if (m->mnt_sb->s_flags & MS_POSIXACL)
424 seq_printf(s, ",acl"); 444 seq_printf(s, ",acl");
445 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS)
446 seq_printf(s, ",mfsymlinks");
425 447
426 seq_printf(s, ",rsize=%d", cifs_sb->rsize); 448 seq_printf(s, ",rsize=%d", cifs_sb->rsize);
427 seq_printf(s, ",wsize=%d", cifs_sb->wsize); 449 seq_printf(s, ",wsize=%d", cifs_sb->wsize);
@@ -437,9 +459,7 @@ static void cifs_umount_begin(struct super_block *sb)
437 if (cifs_sb == NULL) 459 if (cifs_sb == NULL)
438 return; 460 return;
439 461
440 tcon = cifs_sb->tcon; 462 tcon = cifs_sb_master_tcon(cifs_sb);
441 if (tcon == NULL)
442 return;
443 463
444 read_lock(&cifs_tcp_ses_lock); 464 read_lock(&cifs_tcp_ses_lock);
445 if ((tcon->tc_count > 1) || (tcon->tidStatus == CifsExiting)) { 465 if ((tcon->tc_count > 1) || (tcon->tidStatus == CifsExiting)) {
@@ -568,6 +588,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
568 /* note that this is called by vfs setlease with the BKL held 588 /* note that this is called by vfs setlease with the BKL held
569 although I doubt that BKL is needed here in cifs */ 589 although I doubt that BKL is needed here in cifs */
570 struct inode *inode = file->f_path.dentry->d_inode; 590 struct inode *inode = file->f_path.dentry->d_inode;
591 struct cifsFileInfo *cfile = file->private_data;
571 592
572 if (!(S_ISREG(inode->i_mode))) 593 if (!(S_ISREG(inode->i_mode)))
573 return -EINVAL; 594 return -EINVAL;
@@ -578,8 +599,8 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
578 ((arg == F_WRLCK) && 599 ((arg == F_WRLCK) &&
579 (CIFS_I(inode)->clientCanCacheAll))) 600 (CIFS_I(inode)->clientCanCacheAll)))
580 return generic_setlease(file, arg, lease); 601 return generic_setlease(file, arg, lease);
581 else if (CIFS_SB(inode->i_sb)->tcon->local_lease && 602 else if (tlink_tcon(cfile->tlink)->local_lease &&
582 !CIFS_I(inode)->clientCanCacheRead) 603 !CIFS_I(inode)->clientCanCacheRead)
583 /* If the server claims to support oplock on this 604 /* If the server claims to support oplock on this
584 file, then we still need to check oplock even 605 file, then we still need to check oplock even
585 if the local_lease mount option is set, but there 606 if the local_lease mount option is set, but there
@@ -912,11 +933,11 @@ init_cifs(void)
912 933
913 rc = cifs_fscache_register(); 934 rc = cifs_fscache_register();
914 if (rc) 935 if (rc)
915 goto out; 936 goto out_clean_proc;
916 937
917 rc = cifs_init_inodecache(); 938 rc = cifs_init_inodecache();
918 if (rc) 939 if (rc)
919 goto out_clean_proc; 940 goto out_unreg_fscache;
920 941
921 rc = cifs_init_mids(); 942 rc = cifs_init_mids();
922 if (rc) 943 if (rc)
@@ -938,19 +959,19 @@ init_cifs(void)
938 return 0; 959 return 0;
939 960
940#ifdef CONFIG_CIFS_UPCALL 961#ifdef CONFIG_CIFS_UPCALL
941 out_unregister_filesystem: 962out_unregister_filesystem:
942 unregister_filesystem(&cifs_fs_type); 963 unregister_filesystem(&cifs_fs_type);
943#endif 964#endif
944 out_destroy_request_bufs: 965out_destroy_request_bufs:
945 cifs_destroy_request_bufs(); 966 cifs_destroy_request_bufs();
946 out_destroy_mids: 967out_destroy_mids:
947 cifs_destroy_mids(); 968 cifs_destroy_mids();
948 out_destroy_inodecache: 969out_destroy_inodecache:
949 cifs_destroy_inodecache(); 970 cifs_destroy_inodecache();
950 out_clean_proc: 971out_unreg_fscache:
951 cifs_proc_clean();
952 cifs_fscache_unregister(); 972 cifs_fscache_unregister();
953 out: 973out_clean_proc:
974 cifs_proc_clean();
954 return rc; 975 return rc;
955} 976}
956 977