diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-09-29 19:51:11 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-06 12:12:44 -0400 |
commit | 7ffec372458d163492e56e663a1b3a2d7be0a0a2 (patch) | |
tree | e404e3d1000ff41e9b27d0ecb4d6a47187e110d7 /fs/cifs/file.c | |
parent | f3983c2133e9bea9c8b4f690737d15e3e9b02491 (diff) |
cifs: add refcounted and timestamped container for holding tcons
Eventually, we'll need to track the use of tcons on a per-sb basis, so that
we know when it's ok to tear them down. Begin this conversion by adding a
new "tcon_link" struct and accessors that get it. For now, the core data
structures are untouched -- cifs_sb still just points to a single tcon and
the pointers are just cast to deal with the accessor functions. A later
patch will flesh this out.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index de046e183d12..1e375abc5eb3 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -224,6 +224,7 @@ int cifs_open(struct inode *inode, struct file *file) | |||
224 | __u32 oplock; | 224 | __u32 oplock; |
225 | struct cifs_sb_info *cifs_sb; | 225 | struct cifs_sb_info *cifs_sb; |
226 | struct cifsTconInfo *tcon; | 226 | struct cifsTconInfo *tcon; |
227 | struct tcon_link *tlink; | ||
227 | struct cifsFileInfo *pCifsFile = NULL; | 228 | struct cifsFileInfo *pCifsFile = NULL; |
228 | struct cifsInodeInfo *pCifsInode; | 229 | struct cifsInodeInfo *pCifsInode; |
229 | char *full_path = NULL; | 230 | char *full_path = NULL; |
@@ -235,7 +236,12 @@ int cifs_open(struct inode *inode, struct file *file) | |||
235 | xid = GetXid(); | 236 | xid = GetXid(); |
236 | 237 | ||
237 | cifs_sb = CIFS_SB(inode->i_sb); | 238 | cifs_sb = CIFS_SB(inode->i_sb); |
238 | tcon = cifs_sb_tcon(cifs_sb); | 239 | tlink = cifs_sb_tlink(cifs_sb); |
240 | if (IS_ERR(tlink)) { | ||
241 | FreeXid(xid); | ||
242 | return PTR_ERR(tlink); | ||
243 | } | ||
244 | tcon = tlink_tcon(tlink); | ||
239 | 245 | ||
240 | pCifsInode = CIFS_I(file->f_path.dentry->d_inode); | 246 | pCifsInode = CIFS_I(file->f_path.dentry->d_inode); |
241 | 247 | ||
@@ -402,6 +408,7 @@ out: | |||
402 | kfree(buf); | 408 | kfree(buf); |
403 | kfree(full_path); | 409 | kfree(full_path); |
404 | FreeXid(xid); | 410 | FreeXid(xid); |
411 | cifs_put_tlink(tlink); | ||
405 | return rc; | 412 | return rc; |
406 | } | 413 | } |
407 | 414 | ||