[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 1/3] usb-mtp: Reallocate buffer in multiples
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 1/3] usb-mtp: Reallocate buffer in multiples of MTP_WRITE_BUF_SZ |
Date: |
Mon, 28 Jan 2019 10:47:41 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 1/28/19 8:24 AM, Bandan Das wrote:
> This is a "pre-patch" to breaking up the write buffer for
> MTP writes. Instead of allocating a mtp buffer equal to size
> sent by the initiator, we start with a small size and reallocate
> multiples (of that small size) as needed.
>
> Signed-off-by: Bandan Das <address@hidden>
> ---
> hw/usb/dev-mtp.c | 26 ++++++++++++--------------
> 1 file changed, 12 insertions(+), 14 deletions(-)
>
> diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
> index 68c5eb8eaa..2f3536a26d 100644
> --- a/hw/usb/dev-mtp.c
> +++ b/hw/usb/dev-mtp.c
> @@ -152,7 +152,6 @@ struct MTPData {
> bool first;
> /* Used for >4G file sizes */
> bool pending;
> - uint64_t cached_length;
> int fd;
> };
>
> @@ -244,6 +243,7 @@ typedef struct {
>
> #define MTP_MANUFACTURER "QEMU"
> #define MTP_PRODUCT "QEMU filesharing"
> +#define MTP_WRITE_BUF_SZ 512000
Why a non-power-of-2 instead of using units.h and writing (512 * KiB)?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature