aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-05-27 12:48:35 -0400
committerPavel Shilovsky <pshilovsky@samba.org>2012-07-24 13:55:02 -0400
commitaf4281dc22f1eb8a9503b53330ca02f57db68b25 (patch)
tree036c41aad2cc46b573c48824f55751e2aadb069b
parentb669f33ca61738171aecc5ae90d776d91b122eb8 (diff)
CIFS: Move informational tcon calls to ops struct
and rename variables in cifs_mount. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r--fs/cifs/cifsglob.h2
-rw-r--r--fs/cifs/connect.c51
-rw-r--r--fs/cifs/smb1ops.c8
3 files changed, 34 insertions, 27 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 2d80d82f41d0..acfa68569f3d 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -213,6 +213,8 @@ struct smb_version_operations {
213 int (*get_dfs_refer)(const unsigned int, struct cifs_ses *, 213 int (*get_dfs_refer)(const unsigned int, struct cifs_ses *,
214 const char *, struct dfs_info3_param **, 214 const char *, struct dfs_info3_param **,
215 unsigned int *, const struct nls_table *, int); 215 unsigned int *, const struct nls_table *, int);
216 /* informational QFS call */
217 void (*qfs_tcon)(const unsigned int, struct cifs_tcon *);
216}; 218};
217 219
218struct smb_version_values { 220struct smb_version_values {
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 70a34d126001..80807923a545 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3600,9 +3600,9 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
3600{ 3600{
3601 int rc; 3601 int rc;
3602 unsigned int xid; 3602 unsigned int xid;
3603 struct cifs_ses *pSesInfo; 3603 struct cifs_ses *ses;
3604 struct cifs_tcon *tcon; 3604 struct cifs_tcon *tcon;
3605 struct TCP_Server_Info *srvTcp; 3605 struct TCP_Server_Info *server;
3606 char *full_path; 3606 char *full_path;
3607 struct tcon_link *tlink; 3607 struct tcon_link *tlink;
3608#ifdef CONFIG_CIFS_DFS_UPCALL 3608#ifdef CONFIG_CIFS_DFS_UPCALL
@@ -3619,39 +3619,39 @@ try_mount_again:
3619 if (referral_walks_count) { 3619 if (referral_walks_count) {
3620 if (tcon) 3620 if (tcon)
3621 cifs_put_tcon(tcon); 3621 cifs_put_tcon(tcon);
3622 else if (pSesInfo) 3622 else if (ses)
3623 cifs_put_smb_ses(pSesInfo); 3623 cifs_put_smb_ses(ses);
3624 3624
3625 free_xid(xid); 3625 free_xid(xid);
3626 } 3626 }
3627#endif 3627#endif
3628 rc = 0; 3628 rc = 0;
3629 tcon = NULL; 3629 tcon = NULL;
3630 pSesInfo = NULL; 3630 ses = NULL;
3631 srvTcp = NULL; 3631 server = NULL;
3632 full_path = NULL; 3632 full_path = NULL;
3633 tlink = NULL; 3633 tlink = NULL;
3634 3634
3635 xid = get_xid(); 3635 xid = get_xid();
3636 3636
3637 /* get a reference to a tcp session */ 3637 /* get a reference to a tcp session */
3638 srvTcp = cifs_get_tcp_session(volume_info); 3638 server = cifs_get_tcp_session(volume_info);
3639 if (IS_ERR(srvTcp)) { 3639 if (IS_ERR(server)) {
3640 rc = PTR_ERR(srvTcp); 3640 rc = PTR_ERR(server);
3641 bdi_destroy(&cifs_sb->bdi); 3641 bdi_destroy(&cifs_sb->bdi);
3642 goto out; 3642 goto out;
3643 } 3643 }
3644 3644
3645 /* get a reference to a SMB session */ 3645 /* get a reference to a SMB session */
3646 pSesInfo = cifs_get_smb_ses(srvTcp, volume_info); 3646 ses = cifs_get_smb_ses(server, volume_info);
3647 if (IS_ERR(pSesInfo)) { 3647 if (IS_ERR(ses)) {
3648 rc = PTR_ERR(pSesInfo); 3648 rc = PTR_ERR(ses);
3649 pSesInfo = NULL; 3649 ses = NULL;
3650 goto mount_fail_check; 3650 goto mount_fail_check;
3651 } 3651 }
3652 3652
3653 /* search for existing tcon to this server share */ 3653 /* search for existing tcon to this server share */
3654 tcon = cifs_get_tcon(pSesInfo, volume_info); 3654 tcon = cifs_get_tcon(ses, volume_info);
3655 if (IS_ERR(tcon)) { 3655 if (IS_ERR(tcon)) {
3656 rc = PTR_ERR(tcon); 3656 rc = PTR_ERR(tcon);
3657 tcon = NULL; 3657 tcon = NULL;
@@ -3672,11 +3672,9 @@ try_mount_again:
3672 } else 3672 } else
3673 tcon->unix_ext = 0; /* server does not support them */ 3673 tcon->unix_ext = 0; /* server does not support them */
3674 3674
3675 /* do not care if following two calls succeed - informational */ 3675 /* do not care if a following call succeed - informational */
3676 if (!tcon->ipc) { 3676 if (!tcon->ipc && server->ops->qfs_tcon)
3677 CIFSSMBQFSDeviceInfo(xid, tcon); 3677 server->ops->qfs_tcon(xid, tcon);
3678 CIFSSMBQFSAttributeInfo(xid, tcon);
3679 }
3680 3678
3681 cifs_sb->wsize = cifs_negotiate_wsize(tcon, volume_info); 3679 cifs_sb->wsize = cifs_negotiate_wsize(tcon, volume_info);
3682 cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info); 3680 cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info);
@@ -3694,8 +3692,8 @@ remote_path_check:
3694 * Chase the referral if found, otherwise continue normally. 3692 * Chase the referral if found, otherwise continue normally.
3695 */ 3693 */
3696 if (referral_walks_count == 0) { 3694 if (referral_walks_count == 0) {
3697 int refrc = expand_dfs_referral(xid, pSesInfo, volume_info, 3695 int refrc = expand_dfs_referral(xid, ses, volume_info, cifs_sb,
3698 cifs_sb, false); 3696 false);
3699 if (!refrc) { 3697 if (!refrc) {
3700 referral_walks_count++; 3698 referral_walks_count++;
3701 goto try_mount_again; 3699 goto try_mount_again;
@@ -3733,8 +3731,7 @@ remote_path_check:
3733 goto mount_fail_check; 3731 goto mount_fail_check;
3734 } 3732 }
3735 3733
3736 rc = expand_dfs_referral(xid, pSesInfo, volume_info, cifs_sb, 3734 rc = expand_dfs_referral(xid, ses, volume_info, cifs_sb, true);
3737 true);
3738 3735
3739 if (!rc) { 3736 if (!rc) {
3740 referral_walks_count++; 3737 referral_walks_count++;
@@ -3756,7 +3753,7 @@ remote_path_check:
3756 goto mount_fail_check; 3753 goto mount_fail_check;
3757 } 3754 }
3758 3755
3759 tlink->tl_uid = pSesInfo->linux_uid; 3756 tlink->tl_uid = ses->linux_uid;
3760 tlink->tl_tcon = tcon; 3757 tlink->tl_tcon = tcon;
3761 tlink->tl_time = jiffies; 3758 tlink->tl_time = jiffies;
3762 set_bit(TCON_LINK_MASTER, &tlink->tl_flags); 3759 set_bit(TCON_LINK_MASTER, &tlink->tl_flags);
@@ -3777,10 +3774,10 @@ mount_fail_check:
3777 /* up accidentally freeing someone elses tcon struct */ 3774 /* up accidentally freeing someone elses tcon struct */
3778 if (tcon) 3775 if (tcon)
3779 cifs_put_tcon(tcon); 3776 cifs_put_tcon(tcon);
3780 else if (pSesInfo) 3777 else if (ses)
3781 cifs_put_smb_ses(pSesInfo); 3778 cifs_put_smb_ses(ses);
3782 else 3779 else
3783 cifs_put_tcp_session(srvTcp); 3780 cifs_put_tcp_session(server);
3784 bdi_destroy(&cifs_sb->bdi); 3781 bdi_destroy(&cifs_sb->bdi);
3785 } 3782 }
3786 3783
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 6d9025b29e54..96eb06ff9dd1 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -410,6 +410,13 @@ cifs_negotiate(const unsigned int xid, struct cifs_ses *ses)
410 return rc; 410 return rc;
411} 411}
412 412
413static void
414cifs_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon)
415{
416 CIFSSMBQFSDeviceInfo(xid, tcon);
417 CIFSSMBQFSAttributeInfo(xid, tcon);
418}
419
413struct smb_version_operations smb1_operations = { 420struct smb_version_operations smb1_operations = {
414 .send_cancel = send_nt_cancel, 421 .send_cancel = send_nt_cancel,
415 .compare_fids = cifs_compare_fids, 422 .compare_fids = cifs_compare_fids,
@@ -435,6 +442,7 @@ struct smb_version_operations smb1_operations = {
435 .tree_connect = CIFSTCon, 442 .tree_connect = CIFSTCon,
436 .tree_disconnect = CIFSSMBTDis, 443 .tree_disconnect = CIFSSMBTDis,
437 .get_dfs_refer = CIFSGetDFSRefer, 444 .get_dfs_refer = CIFSGetDFSRefer,
445 .qfs_tcon = cifs_qfs_tcon,
438}; 446};
439 447
440struct smb_version_values smb1_values = { 448struct smb_version_values smb1_values = {