diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-09-20 19:01:33 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-09-29 15:04:32 -0400 |
commit | a6e8a8455c94565c53e1a1756d2ab9d9e3a902b8 (patch) | |
tree | 544628293da6aa14a136c915d887d0abdc689a03 /fs/cifs/cifsfs.c | |
parent | ba00ba64cf0895e4c2ac507e56306363dc125a90 (diff) |
cifs: add function to get a tcon from cifs_sb
When we convert cifs to do multiple sessions per mount, we'll need more
than one tcon per superblock. At that point "cifs_sb->tcon" will make
no sense. Add a new accessor function that gets a tcon given a cifs_sb.
For now, it just returns cifs_sb->tcon. Later it'll do more.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 7193494efc03..b9624abb7261 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -137,9 +137,6 @@ cifs_read_super(struct super_block *sb, void *data, | |||
137 | sb->s_magic = CIFS_MAGIC_NUMBER; | 137 | sb->s_magic = CIFS_MAGIC_NUMBER; |
138 | sb->s_op = &cifs_super_ops; | 138 | sb->s_op = &cifs_super_ops; |
139 | sb->s_bdi = &cifs_sb->bdi; | 139 | sb->s_bdi = &cifs_sb->bdi; |
140 | /* if (cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512) | ||
141 | sb->s_blocksize = | ||
142 | cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */ | ||
143 | sb->s_blocksize = CIFS_MAX_MSGSIZE; | 140 | sb->s_blocksize = CIFS_MAX_MSGSIZE; |
144 | sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */ | 141 | sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */ |
145 | inode = cifs_root_iget(sb, ROOT_I); | 142 | inode = cifs_root_iget(sb, ROOT_I); |
@@ -225,7 +222,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
225 | { | 222 | { |
226 | struct super_block *sb = dentry->d_sb; | 223 | struct super_block *sb = dentry->d_sb; |
227 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | 224 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); |
228 | struct cifsTconInfo *tcon = cifs_sb->tcon; | 225 | struct cifsTconInfo *tcon = cifs_sb_tcon(cifs_sb); |
229 | int rc = -EOPNOTSUPP; | 226 | int rc = -EOPNOTSUPP; |
230 | int xid; | 227 | int xid; |
231 | 228 | ||
@@ -367,7 +364,7 @@ static int | |||
367 | cifs_show_options(struct seq_file *s, struct vfsmount *m) | 364 | cifs_show_options(struct seq_file *s, struct vfsmount *m) |
368 | { | 365 | { |
369 | struct cifs_sb_info *cifs_sb = CIFS_SB(m->mnt_sb); | 366 | struct cifs_sb_info *cifs_sb = CIFS_SB(m->mnt_sb); |
370 | struct cifsTconInfo *tcon = cifs_sb->tcon; | 367 | struct cifsTconInfo *tcon = cifs_sb_tcon(cifs_sb); |
371 | struct sockaddr *srcaddr; | 368 | struct sockaddr *srcaddr; |
372 | srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr; | 369 | srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr; |
373 | 370 | ||
@@ -458,9 +455,7 @@ static void cifs_umount_begin(struct super_block *sb) | |||
458 | if (cifs_sb == NULL) | 455 | if (cifs_sb == NULL) |
459 | return; | 456 | return; |
460 | 457 | ||
461 | tcon = cifs_sb->tcon; | 458 | tcon = cifs_sb_tcon(cifs_sb); |
462 | if (tcon == NULL) | ||
463 | return; | ||
464 | 459 | ||
465 | read_lock(&cifs_tcp_ses_lock); | 460 | read_lock(&cifs_tcp_ses_lock); |
466 | if ((tcon->tc_count > 1) || (tcon->tidStatus == CifsExiting)) { | 461 | if ((tcon->tc_count > 1) || (tcon->tidStatus == CifsExiting)) { |