Lines Matching refs:tcon
342 smb2_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *volume_info)
344 struct TCP_Server_Info *server = tcon->ses->server;
357 smb3_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *volume_info)
359 struct TCP_Server_Info *server = tcon->ses->server;
389 smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info)
391 struct TCP_Server_Info *server = tcon->ses->server;
405 smb3_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info)
407 struct TCP_Server_Info *server = tcon->ses->server;
580 SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon)
587 struct cifs_ses *ses = tcon->ses;
589 rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
630 SMB2_close(0, cfid->tcon, cfid->fid->persistent_fid,
672 int open_shroot(unsigned int xid, struct cifs_tcon *tcon,
676 struct cifs_ses *ses = tcon->ses;
691 mutex_lock(&tcon->crfid.fid_mutex);
692 if (tcon->crfid.is_valid) {
694 *cfid = &tcon->crfid;
695 kref_get(&tcon->crfid.refcount);
696 mutex_unlock(&tcon->crfid.fid_mutex);
707 mutex_unlock(&tcon->crfid.fid_mutex);
709 if (smb3_encryption_required(tcon))
715 pfid = tcon->crfid.fid;
727 oparms.tcon = tcon;
734 rc = SMB2_open_init(tcon, server,
738 smb2_set_next_command(tcon, &rqst[0]);
744 rc = SMB2_query_info_init(tcon, server,
758 mutex_lock(&tcon->crfid.fid_mutex);
765 if (tcon->crfid.is_valid) {
779 memcpy(pfid, tcon->crfid.fid, sizeof(*pfid));
780 kref_get(&tcon->crfid.refcount);
782 mutex_unlock(&tcon->crfid.fid_mutex);
786 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
796 tcon->need_reconnect = true;
798 tcon->treeName);
803 atomic_inc(&tcon->num_remote_opens);
812 memcpy(tcon->crfid.fid, pfid, sizeof(struct cifs_fid));
813 tcon->crfid.tcon = tcon;
814 tcon->crfid.is_valid = true;
815 kref_init(&tcon->crfid.refcount);
819 kref_get(&tcon->crfid.refcount);
820 tcon->crfid.has_lease = true;
835 (char *)&tcon->crfid.file_all_info))
836 tcon->crfid.file_all_info_is_valid = true;
839 mutex_unlock(&tcon->crfid.fid_mutex);
846 *cfid = &tcon->crfid;
851 smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon,
859 bool no_cached_open = tcon->nohandlecache;
863 .tcon = tcon,
874 rc = open_shroot(xid, tcon, cifs_sb, &cfid);
881 SMB3_request_interfaces(xid, tcon);
883 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
885 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
887 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
889 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
892 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
898 smb2_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon,
907 oparms.tcon = tcon;
919 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
921 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
923 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
927 smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
936 if ((*full_path == 0) && tcon->crfid.is_valid)
943 oparms.tcon = tcon;
957 rc = SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
963 smb2_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon,
972 smb2_query_file_info(const unsigned int xid, struct cifs_tcon *tcon,
983 rc = SMB2_query_info(xid, tcon, fid->persistent_fid, fid->volatile_fid,
1077 smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon,
1093 rc = smb2_query_info_compound(xid, tcon, utf16_path,
1133 smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
1138 struct cifs_ses *ses = tcon->ses;
1159 if (smb3_encryption_required(tcon))
1175 rc = ses->server->ops->query_all_EAs(xid, tcon, path,
1186 rc = smb2_query_info_compound(xid, tcon, utf16_path,
1221 oparms.tcon = tcon;
1228 rc = SMB2_open_init(tcon, server,
1232 smb2_set_next_command(tcon, &rqst[0]);
1255 rc = SMB2_set_info_init(tcon, server,
1262 smb2_set_next_command(tcon, &rqst[1]);
1270 rc = SMB2_close_init(tcon, server,
1301 smb2_clear_stats(struct cifs_tcon *tcon)
1306 atomic_set(&tcon->stats.smb2_stats.smb2_com_sent[i], 0);
1307 atomic_set(&tcon->stats.smb2_stats.smb2_com_failed[i], 0);
1312 smb2_dump_share_caps(struct seq_file *m, struct cifs_tcon *tcon)
1315 if (tcon->capabilities & SMB2_SHARE_CAP_DFS)
1317 if (tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY)
1319 if (tcon->capabilities & SMB2_SHARE_CAP_SCALEOUT)
1321 if (tcon->capabilities & SMB2_SHARE_CAP_CLUSTER)
1323 if (tcon->capabilities & SMB2_SHARE_CAP_ASYMMETRIC)
1325 if (tcon->capabilities == 0)
1327 if (tcon->ss_flags & SSINFO_FLAGS_ALIGNED_DEVICE)
1329 if (tcon->ss_flags & SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE)
1331 if (tcon->ss_flags & SSINFO_FLAGS_NO_SEEK_PENALTY)
1333 if (tcon->ss_flags & SSINFO_FLAGS_TRIM_ENABLED)
1336 seq_printf(m, "\tShare Flags: 0x%x", tcon->share_flags);
1337 seq_printf(m, "\n\ttid: 0x%x", tcon->tid);
1338 if (tcon->perf_sector_size)
1340 tcon->perf_sector_size);
1341 seq_printf(m, "\tMaximal Access: 0x%x", tcon->maximal_access);
1345 smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
1347 atomic_t *sent = tcon->stats.smb2_stats.smb2_com_sent;
1348 atomic_t *failed = tcon->stats.smb2_stats.smb2_com_failed;
1352 * totals (requests sent) since those SMBs are per-session not per tcon
1355 (long long)(tcon->bytes_read),
1356 (long long)(tcon->bytes_written));
1358 atomic_read(&tcon->num_local_opens),
1359 atomic_read(&tcon->num_remote_opens));
1423 smb2_close_file(const unsigned int xid, struct cifs_tcon *tcon,
1426 SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
1430 smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
1437 rc = __SMB2_close(xid, tcon, cfile->fid.persistent_fid,
1469 SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon,
1477 rc = SMB2_ioctl(xid, tcon, persistent_fid, volatile_fid,
1509 struct cifs_tcon *tcon,
1517 struct cifs_ses *ses = tcon->ses;
1558 if (smb3_encryption_required(tcon))
1574 oparms.tcon = tcon;
1601 rc = SMB2_open_init(tcon, server,
1605 smb2_set_next_command(tcon, &rqst[0]);
1617 rc = SMB2_ioctl_init(tcon, server, &rqst[1], COMPOUND_FID, COMPOUND_FID,
1639 rc = SMB2_set_info_init(tcon, server, &rqst[1], COMPOUND_FID, COMPOUND_FID,
1647 rc = SMB2_query_info_init(tcon, server,
1662 smb2_set_next_command(tcon, &rqst[1]);
1669 rc = SMB2_close_init(tcon, server,
1748 struct cifs_tcon *tcon;
1781 tcon = tlink_tcon(trgtfile->tlink);
1787 cpu_to_le32(min_t(u64, len, tcon->max_bytes_chunk));
1792 rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid,
1855 tcon->max_bytes_chunk)
1856 tcon->max_bytes_chunk =
1877 smb2_flush_file(const unsigned int xid, struct cifs_tcon *tcon,
1880 return SMB2_flush(xid, tcon, fid->persistent_fid, fid->volatile_fid);
1925 static bool smb2_set_sparse(const unsigned int xid, struct cifs_tcon *tcon,
1950 if (tcon->broken_sparse_sup)
1953 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
1957 tcon->broken_sparse_sup = true;
1971 smb2_set_file_size(const unsigned int xid, struct cifs_tcon *tcon,
1987 smb2_set_sparse(xid, tcon, cfile, inode, set_sparse);
1990 return SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
2004 struct cifs_tcon *tcon = tlink_tcon(trgtfile->tlink);
2007 if ((le32_to_cpu(tcon->fsAttrInfo.Attributes) &
2021 rc = smb2_set_file_size(xid, tcon, trgtfile, dest_off + len, false);
2034 rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid,
2050 smb2_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
2053 return SMB2_set_compression(xid, tcon, cfile->fid.persistent_fid,
2058 smb3_set_integrity(const unsigned int xid, struct cifs_tcon *tcon,
2068 return SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
2088 smb3_enum_snapshots(const unsigned int xid, struct cifs_tcon *tcon,
2120 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
2181 struct cifs_tcon *tcon;
2204 tcon = cifs_sb_master_tcon(cifs_sb);
2205 oparms.tcon = tcon;
2217 rc = SMB2_change_notify(xid, tcon, fid.persistent_fid, fid.volatile_fid,
2220 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
2231 smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
2247 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses);
2253 if (smb3_encryption_required(tcon))
2265 oparms.tcon = tcon;
2272 rc = SMB2_open_init(tcon, server,
2276 smb2_set_next_command(tcon, &rqst[0]);
2286 rc = SMB2_query_directory_init(xid, tcon, server,
2295 rc = compound_send_recv(xid, tcon->ses, server,
2310 SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
2313 tcon->tid, tcon->ses->Suid, 0, 0, rc);
2317 atomic_inc(&tcon->num_remote_opens);
2322 tcon->tid, tcon->ses->Suid, 0, 0);
2328 rc = smb2_parse_query_directory(tcon, &rsp_iov[1], resp_buftype[1],
2331 trace_smb3_query_dir_err(xid, fid->persistent_fid, tcon->tid,
2332 tcon->ses->Suid, 0, 0, rc);
2337 trace_smb3_query_dir_done(xid, fid->persistent_fid, tcon->tid,
2338 tcon->ses->Suid, 0, srch_inf->entries_in_buffer);
2350 smb2_query_dir_next(const unsigned int xid, struct cifs_tcon *tcon,
2354 return SMB2_query_directory(xid, tcon, fid->persistent_fid,
2359 smb2_close_dir(const unsigned int xid, struct cifs_tcon *tcon,
2362 return SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
2416 smb2_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid,
2419 if (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LEASING)
2420 return SMB2_lease_break(0, tcon, cinode->lease_key,
2423 return SMB2_oplock_break(0, tcon, fid->persistent_fid,
2444 smb2_set_next_command(struct cifs_tcon *tcon, struct smb_rqst *rqst)
2447 struct cifs_ses *ses = tcon->ses;
2465 if (!smb3_encryption_required(tcon)) {
2505 smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon,
2511 struct cifs_ses *ses = tcon->ses;
2525 if (smb3_encryption_required(tcon))
2536 oparms.tcon = tcon;
2543 rc = SMB2_open_init(tcon, server,
2547 smb2_set_next_command(tcon, &rqst[0]);
2553 rc = SMB2_query_info_init(tcon, server,
2560 smb2_set_next_command(tcon, &rqst[1]);
2567 rc = SMB2_close_init(tcon, server,
2579 tcon->need_reconnect = true;
2581 tcon->treeName);
2598 smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
2609 rc = smb2_query_info_compound(xid, tcon, &utf16_path,
2635 smb311_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
2644 if (!tcon->posix_extensions)
2645 return smb2_queryfs(xid, tcon, cifs_sb, buf);
2647 oparms.tcon = tcon;
2659 rc = SMB311_posix_qfs_info(xid, tcon, fid.persistent_fid,
2662 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
2712 struct cifs_tcon *tcon;
2720 * Try to use the IPC tcon, otherwise just use any
2722 tcon = ses->tcon_ipc;
2723 if (tcon == NULL) {
2725 tcon = list_first_entry_or_null(&ses->tcon_list,
2728 if (tcon)
2729 tcon->tc_count++;
2733 if (tcon == NULL) {
2734 cifs_dbg(VFS, "session %p has no tcon available for a dfs referral request\n",
2762 rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
2786 if (tcon && !tcon->ipc) {
2789 tcon->tc_count--;
2895 smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
2907 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses);
2929 if (smb3_encryption_required(tcon))
2946 oparms.tcon = tcon;
2953 rc = SMB2_open_init(tcon, server,
2957 smb2_set_next_command(tcon, &rqst[0]);
2965 rc = SMB2_ioctl_init(tcon, server,
2974 smb2_set_next_command(tcon, &rqst[1]);
2983 rc = SMB2_close_init(tcon, server,
2990 rc = compound_send_recv(xid, tcon->ses, server,
3083 smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon,
3092 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses);
3106 if (smb3_encryption_required(tcon))
3126 oparms.tcon = tcon;
3133 rc = SMB2_open_init(tcon, server,
3137 smb2_set_next_command(tcon, &rqst[0]);
3145 rc = SMB2_ioctl_init(tcon, server,
3154 smb2_set_next_command(tcon, &rqst[1]);
3163 rc = SMB2_close_init(tcon, server,
3170 rc = compound_send_recv(xid, tcon->ses, server,
3250 struct cifs_tcon *tcon;
3260 tcon = tlink_tcon(tlink);
3270 oparms.tcon = tcon;
3288 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
3307 struct cifs_tcon *tcon;
3318 tcon = tlink_tcon(tlink);
3333 oparms.tcon = tcon;
3347 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
3374 static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
3377 struct cifs_ses *ses = tcon->ses;
3391 trace_smb3_zero_enter(xid, cfile->fid.persistent_fid, tcon->tid,
3405 tcon->tid, ses->Suid, offset, len, rc);
3415 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3428 rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
3435 trace_smb3_zero_err(xid, cfile->fid.persistent_fid, tcon->tid,
3438 trace_smb3_zero_done(xid, cfile->fid.persistent_fid, tcon->tid,
3443 static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
3458 if (!smb2_set_sparse(xid, tcon, cfile, inode, set_sparse)) {
3474 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3486 struct cifs_tcon *tcon,
3498 io_parms.tcon = tcon;
3523 struct cifs_tcon *tcon,
3535 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3556 rc = smb3_simple_fallocate_write_range(xid, tcon,
3575 rc = smb3_simple_fallocate_write_range(xid, tcon,
3606 static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
3621 trace_smb3_falloc_enter(xid, cfile->fid.persistent_fid, tcon->tid,
3622 tcon->ses->Suid, off, len);
3627 tcon->tid, tcon->ses->Suid, off, len, rc);
3641 smb2_set_sparse(xid, tcon, cfile, inode, false);
3644 rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
3699 rc = smb3_simple_fallocate_range(xid, tcon, cfile,
3718 smb2_set_sparse(xid, tcon, cfile, inode, false);
3723 trace_smb3_falloc_err(xid, cfile->fid.persistent_fid, tcon->tid,
3724 tcon->ses->Suid, off, len, rc);
3726 trace_smb3_falloc_done(xid, cfile->fid.persistent_fid, tcon->tid,
3727 tcon->ses->Suid, off, len);
3733 static loff_t smb3_llseek(struct file *file, struct cifs_tcon *tcon, loff_t offset, int whence)
3763 smb2_flush_file(xid, tcon, &wrcfile->fid);
3776 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3817 static int smb3_fiemap(struct cifs_tcon *tcon,
3836 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3892 static long smb3_fallocate(struct file *file, struct cifs_tcon *tcon, int mode,
3897 return smb3_punch_hole(file, tcon, off, len);
3900 return smb3_zero_range(file, tcon, off, len, true);
3901 return smb3_zero_range(file, tcon, off, len, false);
3903 return smb3_simple_falloc(file, tcon, off, len, true);
3905 return smb3_simple_falloc(file, tcon, off, len, false);
5033 struct dentry *dentry, struct cifs_tcon *tcon,
5073 oparms.tcon = tcon;
5083 if (tcon->ses->server->oplocks)
5087 rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, buf);
5098 io_parms.tcon = tcon;
5107 rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
5113 rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
5116 tcon->ses->server->ops->close(xid, tcon, &fid);