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/dir.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/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 613589cf5172..f660a15eb14f 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -64,8 +64,8 @@ build_path_from_dentry(struct dentry *direntry) | |||
64 | cifs_sb = CIFS_SB(direntry->d_sb); | 64 | cifs_sb = CIFS_SB(direntry->d_sb); |
65 | dirsep = CIFS_DIR_SEP(cifs_sb); | 65 | dirsep = CIFS_DIR_SEP(cifs_sb); |
66 | pplen = cifs_sb->prepathlen; | 66 | pplen = cifs_sb->prepathlen; |
67 | if (cifs_sb->tcon && (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS)) | 67 | if (cifs_sb_tcon(cifs_sb) && (cifs_sb_tcon(cifs_sb)->Flags & SMB_SHARE_IS_IN_DFS)) |
68 | dfsplen = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE + 1); | 68 | dfsplen = strnlen(cifs_sb_tcon(cifs_sb)->treeName, MAX_TREE_SIZE + 1); |
69 | else | 69 | else |
70 | dfsplen = 0; | 70 | dfsplen = 0; |
71 | cifs_bp_rename_retry: | 71 | cifs_bp_rename_retry: |
@@ -117,7 +117,7 @@ cifs_bp_rename_retry: | |||
117 | /* BB test paths to Windows with '/' in the midst of prepath */ | 117 | /* BB test paths to Windows with '/' in the midst of prepath */ |
118 | 118 | ||
119 | if (dfsplen) { | 119 | if (dfsplen) { |
120 | strncpy(full_path, cifs_sb->tcon->treeName, dfsplen); | 120 | strncpy(full_path, cifs_sb_tcon(cifs_sb)->treeName, dfsplen); |
121 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) { | 121 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) { |
122 | int i; | 122 | int i; |
123 | for (i = 0; i < dfsplen; i++) { | 123 | for (i = 0; i < dfsplen; i++) { |
@@ -150,7 +150,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, | |||
150 | pCifsFile->pfile = file; | 150 | pCifsFile->pfile = file; |
151 | pCifsFile->invalidHandle = false; | 151 | pCifsFile->invalidHandle = false; |
152 | pCifsFile->closePend = false; | 152 | pCifsFile->closePend = false; |
153 | pCifsFile->tcon = cifs_sb->tcon; | 153 | pCifsFile->tcon = cifs_sb_tcon(cifs_sb); |
154 | mutex_init(&pCifsFile->fh_mutex); | 154 | mutex_init(&pCifsFile->fh_mutex); |
155 | mutex_init(&pCifsFile->lock_mutex); | 155 | mutex_init(&pCifsFile->lock_mutex); |
156 | INIT_LIST_HEAD(&pCifsFile->llist); | 156 | INIT_LIST_HEAD(&pCifsFile->llist); |
@@ -158,7 +158,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, | |||
158 | INIT_WORK(&pCifsFile->oplock_break, cifs_oplock_break); | 158 | INIT_WORK(&pCifsFile->oplock_break, cifs_oplock_break); |
159 | 159 | ||
160 | write_lock(&GlobalSMBSeslock); | 160 | write_lock(&GlobalSMBSeslock); |
161 | list_add(&pCifsFile->tlist, &cifs_sb->tcon->openFileList); | 161 | list_add(&pCifsFile->tlist, &cifs_sb_tcon(cifs_sb)->openFileList); |
162 | pCifsInode = CIFS_I(newinode); | 162 | pCifsInode = CIFS_I(newinode); |
163 | if (pCifsInode) { | 163 | if (pCifsInode) { |
164 | /* if readable file instance put first in list*/ | 164 | /* if readable file instance put first in list*/ |
@@ -225,7 +225,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode, | |||
225 | posix_flags |= SMB_O_DIRECT; | 225 | posix_flags |= SMB_O_DIRECT; |
226 | 226 | ||
227 | mode &= ~current_umask(); | 227 | mode &= ~current_umask(); |
228 | rc = CIFSPOSIXCreate(xid, cifs_sb->tcon, posix_flags, mode, | 228 | rc = CIFSPOSIXCreate(xid, cifs_sb_tcon(cifs_sb), posix_flags, mode, |
229 | pnetfid, presp_data, poplock, full_path, | 229 | pnetfid, presp_data, poplock, full_path, |
230 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | 230 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & |
231 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 231 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
@@ -298,7 +298,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
298 | xid = GetXid(); | 298 | xid = GetXid(); |
299 | 299 | ||
300 | cifs_sb = CIFS_SB(inode->i_sb); | 300 | cifs_sb = CIFS_SB(inode->i_sb); |
301 | tcon = cifs_sb->tcon; | 301 | tcon = cifs_sb_tcon(cifs_sb); |
302 | 302 | ||
303 | full_path = build_path_from_dentry(direntry); | 303 | full_path = build_path_from_dentry(direntry); |
304 | if (full_path == NULL) { | 304 | if (full_path == NULL) { |
@@ -373,7 +373,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
373 | if (!tcon->unix_ext && (mode & S_IWUGO) == 0) | 373 | if (!tcon->unix_ext && (mode & S_IWUGO) == 0) |
374 | create_options |= CREATE_OPTION_READONLY; | 374 | create_options |= CREATE_OPTION_READONLY; |
375 | 375 | ||
376 | if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS) | 376 | if (tcon->ses->capabilities & CAP_NT_SMBS) |
377 | rc = CIFSSMBOpen(xid, tcon, full_path, disposition, | 377 | rc = CIFSSMBOpen(xid, tcon, full_path, disposition, |
378 | desiredAccess, create_options, | 378 | desiredAccess, create_options, |
379 | &fileHandle, &oplock, buf, cifs_sb->local_nls, | 379 | &fileHandle, &oplock, buf, cifs_sb->local_nls, |
@@ -504,7 +504,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, | |||
504 | xid = GetXid(); | 504 | xid = GetXid(); |
505 | 505 | ||
506 | cifs_sb = CIFS_SB(inode->i_sb); | 506 | cifs_sb = CIFS_SB(inode->i_sb); |
507 | pTcon = cifs_sb->tcon; | 507 | pTcon = cifs_sb_tcon(cifs_sb); |
508 | 508 | ||
509 | full_path = build_path_from_dentry(direntry); | 509 | full_path = build_path_from_dentry(direntry); |
510 | if (full_path == NULL) { | 510 | if (full_path == NULL) { |
@@ -631,7 +631,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
631 | /* check whether path exists */ | 631 | /* check whether path exists */ |
632 | 632 | ||
633 | cifs_sb = CIFS_SB(parent_dir_inode->i_sb); | 633 | cifs_sb = CIFS_SB(parent_dir_inode->i_sb); |
634 | pTcon = cifs_sb->tcon; | 634 | pTcon = cifs_sb_tcon(cifs_sb); |
635 | 635 | ||
636 | /* | 636 | /* |
637 | * Don't allow the separator character in a path component. | 637 | * Don't allow the separator character in a path component. |