From patchwork Fri Nov 15 17:34:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 3189311 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50FABC045B for ; Fri, 15 Nov 2013 17:34:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 691E020925 for ; Fri, 15 Nov 2013 17:34:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62FAB20931 for ; Fri, 15 Nov 2013 17:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658Ab3KOReT (ORCPT ); Fri, 15 Nov 2013 12:34:19 -0500 Received: from mail-pb0-f43.google.com ([209.85.160.43]:34274 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009Ab3KOReT (ORCPT ); Fri, 15 Nov 2013 12:34:19 -0500 Received: by mail-pb0-f43.google.com with SMTP id rq2so1759949pbb.30 for ; Fri, 15 Nov 2013 09:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=u4yn1KXXJ2Pyv3Li5JF0nmpkqTd/YTcHXZ0JHPHz0II=; b=ayxGyIcgTRyg41HbSknnvH7RiRzLSm6DgjPoRhnjTLQBIYkUgM7oa6fsQHzPkYu9o3 Hj54/YkKfWXClBZimLaiwHlkLRZ/XxTdbzTudbPdEUabPmpl2Tv5kiVKJ6qwkvb0O/is VDrImw/X/Fx7Z/cqc+hUxvtvgoHW7hxkak2qRZuZGHLTLnhQvAuSduGRNPHNqLf3b2tn 2CobTeEta+YNfbcEHDfQCYwYGiv9HnC0cxTvhRX98bJyo20p/IOEIEdAHsjMJ77HTih1 gOm0whA3Wuxf5jbJDP2CC29hSM3HfIE8NttzCv4SLEJvjdJfN+ZdfvpBFALCyPZJn3GY rC5g== MIME-Version: 1.0 X-Received: by 10.68.226.199 with SMTP id ru7mr353929pbc.64.1384536858686; Fri, 15 Nov 2013 09:34:18 -0800 (PST) Received: by 10.68.143.10 with HTTP; Fri, 15 Nov 2013 09:34:18 -0800 (PST) Date: Fri, 15 Nov 2013 11:34:18 -0600 Message-ID: Subject: [CIFS][PATCH] set copy chunk defaults From: Steve French To: "linux-cifs@vger.kernel.org" , samba-technical , David Disseldorp , Christof Schmitt Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From e53cf824641ad237e1b7ceb09aefbfbfb1787f47 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 15 Nov 2013 11:26:24 -0600 Subject: [PATCH] [CIFS] Set copychunk defaults Patch 2 of the copy chunk series (the final patch will use these to handle copies of files larger than the chunk size. We set the same defaults that Windows and Samba expect for CopyChunk. Signed-off-by: Steve French Reviewed-by: David Disseldorp --- fs/cifs/cifsglob.h | 3 +++ fs/cifs/smb2pdu.c | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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, if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); - + init_copy_chunk_defaults(tcon); tcon_exit: free_rsp_buf(resp_buftype, rsp); kfree(unc_path); From e53cf824641ad237e1b7ceb09aefbfbfb1787f47 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 15 Nov 2013 11:26:24 -0600 Subject: [PATCH] [CIFS] Set copychunk defaults Patch 2 of the copy chunk series (the final patch will use these to handle copies of files larger than the chunk size. We set the same defaults that Windows and Samba expect for CopyChunk. Signed-off-by: Steve French --- fs/cifs/cifsglob.h | 3 +++ fs/cifs/smb2pdu.c | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 50a6ca1..d9ea7ad 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -858,6 +858,9 @@ struct cifs_tcon { __le64 vol_create_time; __u32 ss_flags; /* sector size flags */ __u32 perf_sector_size; /* best sector size for perf */ + __u32 max_chunks; + __u32 max_bytes_chunk; + __u32 max_bytes_copy; #endif /* CONFIG_CIFS_SMB2 */ #ifdef CONFIG_CIFS_FSCACHE u64 resource_id; /* server resource id */ diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 8ab05b0..ca7f307 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) #define MAX_SHARENAME_LENGTH (255 /* server */ + 80 /* share */ + 1 /* NULL */) +/* These are similar values to what Windows uses */ +static inline void init_copy_chunk_defaults(struct cifs_tcon *tcon) +{ + tcon->max_chunks = 256; + tcon->max_bytes_chunk = 1048576; + tcon->max_bytes_copy = 16777216; +} + int SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, 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, if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); - + init_copy_chunk_defaults(tcon); tcon_exit: free_rsp_buf(resp_buftype, rsp); kfree(unc_path); -- 1.8.3.1