Lines Matching refs:tcon
437 smb2_negotiate_wsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
439 struct TCP_Server_Info *server = tcon->ses->server;
452 smb3_negotiate_wsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
454 struct TCP_Server_Info *server = tcon->ses->server;
484 smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
486 struct TCP_Server_Info *server = tcon->ses->server;
500 smb3_negotiate_rsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
502 struct TCP_Server_Info *server = tcon->ses->server;
758 SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_mount)
763 struct cifs_ses *ses = tcon->ses;
772 rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
805 smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon,
816 .tcon = tcon,
824 rc = open_cached_dir(xid, tcon, "", cifs_sb, false, &cfid);
833 SMB3_request_interfaces(xid, tcon, true /* called during mount */);
835 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
837 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
839 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
841 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
844 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
850 smb2_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon,
860 .tcon = tcon,
873 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
875 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
877 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
881 smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
894 rc = open_cached_dir(xid, tcon, full_path, cifs_sb, true, &cfid);
908 .tcon = tcon,
925 rc2 = cifs_inval_name_dfs_link_error(xid, tcon, cifs_sb,
940 rc = SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
948 static int smb2_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon,
956 static int smb2_query_file_info(const unsigned int xid, struct cifs_tcon *tcon,
966 return SMB2_query_info(xid, tcon, fid->persistent_fid, fid->volatile_fid, &data->fi);
1055 smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon,
1066 rc = smb2_query_info_compound(xid, tcon, path,
1104 smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
1110 struct cifs_ses *ses = tcon->ses;
1128 if (smb3_encryption_required(tcon))
1149 rc = ses->server->ops->query_all_EAs(xid, tcon, path,
1160 rc = smb2_query_info_compound(xid, tcon, path,
1194 .tcon = tcon,
1202 rc = SMB2_open_init(tcon, server,
1206 smb2_set_next_command(tcon, &rqst[0]);
1228 rc = SMB2_set_info_init(tcon, server,
1235 smb2_set_next_command(tcon, &rqst[1]);
1241 rc = SMB2_close_init(tcon, server,
1274 smb2_clear_stats(struct cifs_tcon *tcon)
1279 atomic_set(&tcon->stats.smb2_stats.smb2_com_sent[i], 0);
1280 atomic_set(&tcon->stats.smb2_stats.smb2_com_failed[i], 0);
1285 smb2_dump_share_caps(struct seq_file *m, struct cifs_tcon *tcon)
1288 if (tcon->capabilities & SMB2_SHARE_CAP_DFS)
1290 if (tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY)
1292 if (tcon->capabilities & SMB2_SHARE_CAP_SCALEOUT)
1294 if (tcon->capabilities & SMB2_SHARE_CAP_CLUSTER)
1296 if (tcon->capabilities & SMB2_SHARE_CAP_ASYMMETRIC)
1298 if (tcon->capabilities == 0)
1300 if (tcon->ss_flags & SSINFO_FLAGS_ALIGNED_DEVICE)
1302 if (tcon->ss_flags & SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE)
1304 if (tcon->ss_flags & SSINFO_FLAGS_NO_SEEK_PENALTY)
1306 if (tcon->ss_flags & SSINFO_FLAGS_TRIM_ENABLED)
1309 seq_printf(m, "\tShare Flags: 0x%x", tcon->share_flags);
1310 seq_printf(m, "\n\ttid: 0x%x", tcon->tid);
1311 if (tcon->perf_sector_size)
1313 tcon->perf_sector_size);
1314 seq_printf(m, "\tMaximal Access: 0x%x", tcon->maximal_access);
1318 smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
1320 atomic_t *sent = tcon->stats.smb2_stats.smb2_com_sent;
1321 atomic_t *failed = tcon->stats.smb2_stats.smb2_com_failed;
1325 * totals (requests sent) since those SMBs are per-session not per tcon
1328 (long long)(tcon->bytes_read),
1329 (long long)(tcon->bytes_written));
1331 atomic_read(&tcon->num_local_opens),
1332 atomic_read(&tcon->num_remote_opens));
1396 smb2_close_file(const unsigned int xid, struct cifs_tcon *tcon,
1399 SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
1403 smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
1410 rc = __SMB2_close(xid, tcon, cfile->fid.persistent_fid,
1445 SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon,
1453 rc = SMB2_ioctl(xid, tcon, persistent_fid, volatile_fid,
1458 pr_warn_once("Server share %s does not support copy range\n", tcon->tree_name);
1478 struct cifs_tcon *tcon,
1486 struct cifs_ses *ses = tcon->ses;
1527 if (smb3_encryption_required(tcon))
1543 .tcon = tcon,
1570 rc = SMB2_open_init(tcon, server,
1574 smb2_set_next_command(tcon, &rqst[0]);
1586 rc = SMB2_ioctl_init(tcon, server, &rqst[1], COMPOUND_FID, COMPOUND_FID,
1608 rc = SMB2_set_info_init(tcon, server, &rqst[1], COMPOUND_FID, COMPOUND_FID,
1616 rc = SMB2_query_info_init(tcon, server,
1631 smb2_set_next_command(tcon, &rqst[1]);
1638 rc = SMB2_close_init(tcon, server,
1717 struct cifs_tcon *tcon;
1741 tcon = tlink_tcon(trgtfile->tlink);
1747 cpu_to_le32(min_t(u64, len, tcon->max_bytes_chunk));
1752 rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid,
1815 tcon->max_bytes_chunk)
1816 tcon->max_bytes_chunk =
1837 smb2_flush_file(const unsigned int xid, struct cifs_tcon *tcon,
1840 return SMB2_flush(xid, tcon, fid->persistent_fid, fid->volatile_fid);
1885 static bool smb2_set_sparse(const unsigned int xid, struct cifs_tcon *tcon,
1910 if (tcon->broken_sparse_sup)
1913 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
1917 tcon->broken_sparse_sup = true;
1931 smb2_set_file_size(const unsigned int xid, struct cifs_tcon *tcon,
1947 smb2_set_sparse(xid, tcon, cfile, inode, set_sparse);
1950 return SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
1964 struct cifs_tcon *tcon = tlink_tcon(trgtfile->tlink);
1967 if ((le32_to_cpu(tcon->fsAttrInfo.Attributes) &
1981 rc = smb2_set_file_size(xid, tcon, trgtfile, dest_off + len, false);
1994 rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid,
2010 smb2_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
2013 return SMB2_set_compression(xid, tcon, cfile->fid.persistent_fid,
2018 smb3_set_integrity(const unsigned int xid, struct cifs_tcon *tcon,
2028 return SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
2048 smb3_enum_snapshots(const unsigned int xid, struct cifs_tcon *tcon,
2080 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
2142 struct cifs_tcon *tcon;
2176 tcon = cifs_sb_master_tcon(cifs_sb);
2178 .tcon = tcon,
2191 rc = SMB2_change_notify(xid, tcon, fid.persistent_fid, fid.volatile_fid,
2195 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
2215 smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
2231 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses);
2238 if (smb3_encryption_required(tcon))
2251 .tcon = tcon,
2259 rc = SMB2_open_init(tcon, server,
2263 smb2_set_next_command(tcon, &rqst[0]);
2273 rc = SMB2_query_directory_init(xid, tcon, server,
2283 rc = compound_send_recv(xid, tcon->ses, server,
2301 SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
2304 tcon->tid, tcon->ses->Suid, 0, 0, rc);
2308 atomic_inc(&tcon->num_remote_opens);
2313 tcon->tid, tcon->ses->Suid, 0, 0);
2319 rc = smb2_parse_query_directory(tcon, &rsp_iov[1], resp_buftype[1],
2322 trace_smb3_query_dir_err(xid, fid->persistent_fid, tcon->tid,
2323 tcon->ses->Suid, 0, 0, rc);
2328 trace_smb3_query_dir_done(xid, fid->persistent_fid, tcon->tid,
2329 tcon->ses->Suid, 0, srch_inf->entries_in_buffer);
2341 smb2_query_dir_next(const unsigned int xid, struct cifs_tcon *tcon,
2345 return SMB2_query_directory(xid, tcon, fid->persistent_fid,
2350 smb2_close_dir(const unsigned int xid, struct cifs_tcon *tcon,
2353 return SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
2422 struct cifs_tcon *tcon;
2432 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
2433 if (tcon->tid == le32_to_cpu(shdr->Id.SyncId.TreeId)) {
2434 spin_lock(&tcon->tc_lock);
2435 tcon->need_reconnect = true;
2436 spin_unlock(&tcon->tc_lock);
2439 tcon->tree_name);
2450 smb2_oplock_response(struct cifs_tcon *tcon, __u64 persistent_fid,
2453 if (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LEASING)
2454 return SMB2_lease_break(0, tcon, cinode->lease_key,
2457 return SMB2_oplock_break(0, tcon, persistent_fid, volatile_fid,
2477 smb2_set_next_command(struct cifs_tcon *tcon, struct smb_rqst *rqst)
2480 struct cifs_ses *ses = tcon->ses;
2498 if (!smb3_encryption_required(tcon)) {
2538 smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon,
2545 struct cifs_ses *ses = tcon->ses;
2564 if (smb3_encryption_required(tcon))
2580 open_cached_dir(xid, tcon, path, cifs_sb, false,
2587 .tcon = tcon,
2595 rc = SMB2_open_init(tcon, server,
2599 smb2_set_next_command(tcon, &rqst[0]);
2605 rc = SMB2_query_info_init(tcon, server,
2613 rc = SMB2_query_info_init(tcon, server,
2624 smb2_set_next_command(tcon, &rqst[1]);
2631 rc = SMB2_close_init(tcon, server,
2649 tcon->need_reconnect = true;
2651 tcon->tree_name);
2673 smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
2683 rc = smb2_query_info_compound(xid, tcon, "",
2704 trace_smb3_qfs_done(xid, tcon->tid, tcon->ses->Suid, tcon->tree_name, rc);
2710 smb311_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
2719 if (!tcon->posix_extensions)
2720 return smb2_queryfs(xid, tcon, cifs_sb, buf);
2723 .tcon = tcon,
2736 rc = SMB311_posix_qfs_info(xid, tcon, fid.persistent_fid,
2739 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
2789 struct cifs_tcon *tcon;
2798 * Try to use the IPC tcon, otherwise just use any
2800 tcon = ses->tcon_ipc;
2801 if (tcon == NULL) {
2803 tcon = list_first_entry_or_null(&ses->tcon_list,
2806 if (tcon)
2807 tcon->tc_count++;
2811 if (tcon == NULL) {
2812 cifs_dbg(VFS, "session %p has no tcon available for a dfs referral request\n",
2840 rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
2867 if (tcon && !tcon->ipc) {
2870 tcon->tc_count--;
2872 WARN_ON(tcon->tc_count < 0);
2997 struct cifs_tcon *tcon,
3009 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses);
3020 if (smb3_encryption_required(tcon))
3044 .tcon = tcon,
3052 rc = SMB2_open_init(tcon, server,
3056 smb2_set_next_command(tcon, &rqst[0]);
3063 rc = SMB2_ioctl_init(tcon, server,
3072 smb2_set_next_command(tcon, &rqst[1]);
3079 rc = SMB2_close_init(tcon, server,
3086 rc = compound_send_recv(xid, tcon->ses, server,
3172 struct cifs_tcon *tcon;
3182 tcon = tlink_tcon(tlink);
3193 .tcon = tcon,
3218 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
3237 struct cifs_tcon *tcon;
3248 tcon = tlink_tcon(tlink);
3266 .tcon = tcon,
3280 SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
3307 static long smb3_zero_data(struct file *file, struct cifs_tcon *tcon,
3318 return SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3325 static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
3328 struct cifs_ses *ses = tcon->ses;
3339 trace_smb3_zero_enter(xid, cfile->fid.persistent_fid, tcon->tid,
3356 rc = smb3_zero_data(file, tcon, offset, len, xid);
3366 rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
3379 trace_smb3_zero_err(xid, cfile->fid.persistent_fid, tcon->tid,
3382 trace_smb3_zero_done(xid, cfile->fid.persistent_fid, tcon->tid,
3387 static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
3402 if (!smb2_set_sparse(xid, tcon, cfile, inode, set_sparse)) {
3419 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3432 struct cifs_tcon *tcon,
3444 io_parms.tcon = tcon;
3469 struct cifs_tcon *tcon,
3481 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3502 rc = smb3_simple_fallocate_write_range(xid, tcon,
3521 rc = smb3_simple_fallocate_write_range(xid, tcon,
3552 static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
3567 trace_smb3_falloc_enter(xid, cfile->fid.persistent_fid, tcon->tid,
3568 tcon->ses->Suid, off, len);
3573 tcon->tid, tcon->ses->Suid, off, len, rc);
3587 smb2_set_sparse(xid, tcon, cfile, inode, false);
3590 rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
3645 rc = smb3_simple_fallocate_range(xid, tcon, cfile,
3664 smb2_set_sparse(xid, tcon, cfile, inode, false);
3669 trace_smb3_falloc_err(xid, cfile->fid.persistent_fid, tcon->tid,
3670 tcon->ses->Suid, off, len, rc);
3672 trace_smb3_falloc_done(xid, cfile->fid.persistent_fid, tcon->tid,
3673 tcon->ses->Suid, off, len);
3679 static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
3714 rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
3732 static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
3761 rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
3773 rc = smb3_zero_data(file, tcon, off, len, xid);
3786 static loff_t smb3_llseek(struct file *file, struct cifs_tcon *tcon, loff_t offset, int whence)
3816 smb2_flush_file(xid, tcon, &wrcfile->fid);
3829 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3870 static int smb3_fiemap(struct cifs_tcon *tcon,
3889 rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid,
3945 static long smb3_fallocate(struct file *file, struct cifs_tcon *tcon, int mode,
3950 return smb3_punch_hole(file, tcon, off, len);
3953 return smb3_zero_range(file, tcon, off, len, true);
3954 return smb3_zero_range(file, tcon, off, len, false);
3956 return smb3_simple_falloc(file, tcon, off, len, true);
3958 return smb3_collapse_range(file, tcon, off, len);
3960 return smb3_insert_range(file, tcon, off, len);
3962 return smb3_simple_falloc(file, tcon, off, len, false);
5107 struct dentry *dentry, struct cifs_tcon *tcon,
5142 .tcon = tcon,
5152 if (tcon->ses->server->oplocks)
5156 rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, &buf);
5167 io_parms.tcon = tcon;
5176 rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
5182 rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
5188 rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
5191 tcon->ses->server->ops->close(xid, tcon, &fid);