aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/cifsglob.h3
-rw-r--r--fs/cifs/smb2pdu.c10
2 files changed, 12 insertions, 1 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 50a6ca1bb521..d9ea7ada1378 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -858,6 +858,9 @@ struct cifs_tcon {
858 __le64 vol_create_time; 858 __le64 vol_create_time;
859 __u32 ss_flags; /* sector size flags */ 859 __u32 ss_flags; /* sector size flags */
860 __u32 perf_sector_size; /* best sector size for perf */ 860 __u32 perf_sector_size; /* best sector size for perf */
861 __u32 max_chunks;
862 __u32 max_bytes_chunk;
863 __u32 max_bytes_copy;
861#endif /* CONFIG_CIFS_SMB2 */ 864#endif /* CONFIG_CIFS_SMB2 */
862#ifdef CONFIG_CIFS_FSCACHE 865#ifdef CONFIG_CIFS_FSCACHE
863 u64 resource_id; /* server resource id */ 866 u64 resource_id; /* server resource id */
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 8ab05b0d6778..ca7f307ad97a 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -717,6 +717,14 @@ static inline void cifs_stats_fail_inc(struct cifs_tcon *tcon, uint16_t code)
717 717
718#define MAX_SHARENAME_LENGTH (255 /* server */ + 80 /* share */ + 1 /* NULL */) 718#define MAX_SHARENAME_LENGTH (255 /* server */ + 80 /* share */ + 1 /* NULL */)
719 719
720/* These are similar values to what Windows uses */
721static inline void init_copy_chunk_defaults(struct cifs_tcon *tcon)
722{
723 tcon->max_chunks = 256;
724 tcon->max_bytes_chunk = 1048576;
725 tcon->max_bytes_copy = 16777216;
726}
727
720int 728int
721SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, 729SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
722 struct cifs_tcon *tcon, const struct nls_table *cp) 730 struct cifs_tcon *tcon, const struct nls_table *cp)
@@ -818,7 +826,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
818 if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && 826 if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) &&
819 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) 827 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
820 cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); 828 cifs_dbg(VFS, "DFS capability contradicts DFS flag\n");
821 829 init_copy_chunk_defaults(tcon);
822tcon_exit: 830tcon_exit:
823 free_rsp_buf(resp_buftype, rsp); 831 free_rsp_buf(resp_buftype, rsp);
824 kfree(unc_path); 832 kfree(unc_path);