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/cifs_dfs_ref.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/cifs_dfs_ref.c')
-rw-r--r-- | fs/cifs/cifs_dfs_ref.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index f1e13ea45a17..f4aab6f01174 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c | |||
@@ -306,6 +306,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) | |||
306 | int xid, i; | 306 | int xid, i; |
307 | int rc = 0; | 307 | int rc = 0; |
308 | struct vfsmount *mnt = ERR_PTR(-ENOENT); | 308 | struct vfsmount *mnt = ERR_PTR(-ENOENT); |
309 | struct tcon_link *tlink; | ||
309 | 310 | ||
310 | cFYI(1, "in %s", __func__); | 311 | cFYI(1, "in %s", __func__); |
311 | BUG_ON(IS_ROOT(dentry)); | 312 | BUG_ON(IS_ROOT(dentry)); |
@@ -315,14 +316,6 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) | |||
315 | dput(nd->path.dentry); | 316 | dput(nd->path.dentry); |
316 | nd->path.dentry = dget(dentry); | 317 | nd->path.dentry = dget(dentry); |
317 | 318 | ||
318 | cifs_sb = CIFS_SB(dentry->d_inode->i_sb); | ||
319 | ses = cifs_sb_tcon(cifs_sb)->ses; | ||
320 | |||
321 | if (!ses) { | ||
322 | rc = -EINVAL; | ||
323 | goto out_err; | ||
324 | } | ||
325 | |||
326 | /* | 319 | /* |
327 | * The MSDFS spec states that paths in DFS referral requests and | 320 | * The MSDFS spec states that paths in DFS referral requests and |
328 | * responses must be prefixed by a single '\' character instead of | 321 | * responses must be prefixed by a single '\' character instead of |
@@ -335,10 +328,20 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) | |||
335 | goto out_err; | 328 | goto out_err; |
336 | } | 329 | } |
337 | 330 | ||
338 | rc = get_dfs_path(xid, ses , full_path + 1, cifs_sb->local_nls, | 331 | cifs_sb = CIFS_SB(dentry->d_inode->i_sb); |
332 | tlink = cifs_sb_tlink(cifs_sb); | ||
333 | if (IS_ERR(tlink)) { | ||
334 | rc = PTR_ERR(tlink); | ||
335 | goto out_err; | ||
336 | } | ||
337 | ses = tlink_tcon(tlink)->ses; | ||
338 | |||
339 | rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls, | ||
339 | &num_referrals, &referrals, | 340 | &num_referrals, &referrals, |
340 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 341 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
341 | 342 | ||
343 | cifs_put_tlink(tlink); | ||
344 | |||
342 | for (i = 0; i < num_referrals; i++) { | 345 | for (i = 0; i < num_referrals; i++) { |
343 | int len; | 346 | int len; |
344 | dump_referral(referrals+i); | 347 | dump_referral(referrals+i); |