From: Leif Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Steve French" <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Aurélien Aptel" <aaptel-IBi9RG/b67k@public.gmane.org>
Subject: Re: [PATCH 01/19] cifs: Add smb2_send_recv
Date: Mon, 20 Nov 2017 17:54:35 -0500 (EST) [thread overview]
Message-ID: <1674281245.28781767.1511218475801.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAKywueQWAnWW=kzbZWbGBgzT+HjiTQC6SXdh-ixrZacY-+_Omw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
That is a good idea.
I can update both functions to do that once the current "remove 1002 from request"
lands.
----- Original Message -----
From: "Pavel Shilovsky" <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Ronnie Sahlberg" <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "linux-cifs" <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, "Steve French" <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, "Aurélien Aptel" <aaptel-IBi9RG/b67k@public.gmane.org>
Sent: Tuesday, 21 November, 2017 8:52:46 AM
Subject: Re: [PATCH 01/19] cifs: Add smb2_send_recv
2017-11-20 13:50 GMT-08:00 Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> 2017-11-19 16:24 GMT-08:00 Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
>> This function is similar to SendReceive2 except it does not expect
>> a 4 byte rfc1002 length header in the first io vector.
>>
>> Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>> fs/cifs/cifsproto.h | 4 ++++
>> fs/cifs/transport.c | 38 ++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 42 insertions(+)
>>
>> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
>> index 4143c9dec463..6d86cd120349 100644
>> --- a/fs/cifs/cifsproto.h
>> +++ b/fs/cifs/cifsproto.h
>> @@ -106,6 +106,10 @@ extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
>> struct kvec *, int /* nvec to send */,
>> int * /* type of buf returned */, const int flags,
>> struct kvec * /* resp vec */);
>> +extern int smb2_send_recv(const unsigned int /* xid */ , struct cifs_ses *,
>> + struct kvec *, int /* nvec to send */,
>> + int * /* type of buf returned */, const int flags,
>> + struct kvec * /* resp vec */);
>> extern int SendReceiveBlockingLock(const unsigned int xid,
>> struct cifs_tcon *ptcon,
>> struct smb_hdr *in_buf ,
>> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
>> index 7efbab013957..e678307bb7a0 100644
>> --- a/fs/cifs/transport.c
>> +++ b/fs/cifs/transport.c
>> @@ -827,6 +827,44 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
>> return rc;
>> }
>>
>> +/* Like SendReceive2 but iov[0] does not contain an rfc1002 header */
>> +int
>> +smb2_send_recv(const unsigned int xid, struct cifs_ses *ses,
>> + struct kvec *iov, int n_vec, int *resp_buf_type /* ret */,
>> + const int flags, struct kvec *resp_iov)
>> +{
>> + struct smb_rqst rqst;
>> + struct kvec *new_iov;
>> + int rc;
>> + int i;
>> + __u32 count;
>> + __be32 rfc1002_marker;
>> +
>> + new_iov = kmalloc(sizeof(struct kvec) * (n_vec + 1), GFP_KERNEL);
>> + if (!new_iov)
>> + return -ENOMEM;
>
> Probably it is out of the scope of this patchset but can we do a
> simple hack here: allocate a fixed size array on stack (suppose iov[8]
> which is more that enough for most cases) and use dynamic allocation
> only if n_vec + 1 is greater than this fixed value? I can use the same
^^^
I == We. Sorry - typo.
> approach in SendReceive2() as well.
next prev parent reply other threads:[~2017-11-20 22:54 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 0:24 [PATCH 00/10] cifs: Remove rfc1002 header from smb2 request structs Ronnie Sahlberg
[not found] ` <20171120002447.32322-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-20 0:24 ` [PATCH 01/19] cifs: Add smb2_send_recv Ronnie Sahlberg
[not found] ` <20171120002447.32322-2-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-20 21:50 ` Pavel Shilovsky
[not found] ` <CAKywueSFic+_oPy9tw7WAWLtP9v2H19cy6kpsieT7cD2w=CVuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-20 21:52 ` Pavel Shilovsky
[not found] ` <CAKywueQWAnWW=kzbZWbGBgzT+HjiTQC6SXdh-ixrZacY-+_Omw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-20 22:54 ` Leif Sahlberg [this message]
2017-11-20 0:24 ` [PATCH 02/19] cifs: remove rfc1002 header from smb2_negotiate_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 03/19] cifs: remove rfc1002 header from smb2_logoff_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 04/19] cifs: remove rfc1002 header from smb2_tree_disconnect_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 05/19] cifs: remove rfc1002 header from smb2_close_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 06/19] cifs: remove rfc1002 header from smb2_ioctl_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 07/19] cifs: remove rfc1002 header from smb2_echo_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 08/19] cifs: remove rfc1002 header from smb2_sess_setup_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 09/19] cifs: remove rfc1002 header from smb2_tree_connect_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 10/19] cifs: remove rfc1002 header from smb2_create_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 11/19] cifs: remove rfc1002 header from smb2_flush_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req Ronnie Sahlberg
[not found] ` <20171120002447.32322-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-20 22:56 ` Pavel Shilovsky
2017-11-20 0:24 ` [PATCH 13/19] cifs: remove rfc1002 header from smb2 read/write requests Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 14/19] cifs: remove rfc1002 header from smb2_lease_ack Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 15/19] cifs: remove rfc1002 header from smb2_oplock_break we get from server Ronnie Sahlberg
[not found] ` <20171120002447.32322-16-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-20 1:45 ` Steve French
2017-11-20 0:24 ` [PATCH 16/19] cifs: remove rfc1002 header from smb2_set_info_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 17/19] cifs: remove rfc1002 header from smb2_query_directory_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 18/19] cifs: remove rfc1002 header from smb2_query_info_req Ronnie Sahlberg
2017-11-20 0:24 ` [PATCH 19/19] cifs: remove small_smb2_init Ronnie Sahlberg
2017-11-20 1:39 ` [PATCH 00/10] cifs: Remove rfc1002 header from smb2 request structs Steve French
-- strict thread matches above, loose matches on Subject: below --
2017-11-21 0:04 [PATCH 00/19 Version 4] cifs: remove rfc1002 from smb2 requests Ronnie Sahlberg
[not found] ` <20171121000442.24888-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-21 0:04 ` [PATCH 01/19] cifs: Add smb2_send_recv Ronnie Sahlberg
2017-11-09 1:14 [PATCH 00/19] Remove rfc1002 header from smb2 request structs Ronnie Sahlberg
[not found] ` <20171109011433.14468-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-09 1:14 ` [PATCH 01/19] cifs: Add smb2_send_recv Ronnie Sahlberg
[not found] ` <20171109011433.14468-2-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-09 14:09 ` Aurélien Aptel
2017-11-17 18:05 ` Steve French
[not found] ` <CAH2r5mvLvAfO3eU2f73ebk2XSJiQvzamWi9FxDqNCU67=Pm8bQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-17 18:11 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1674281245.28781767.1511218475801.JavaMail.zimbra@redhat.com \
--to=lsahlber-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=aaptel-IBi9RG/b67k@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox