qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>,
	qemu-devel@nongnu.org
Cc: amarkovic@wavecomp.com
Subject: Re: [PATCH v2 2/4] linux-user: Add support for FITRIM ioctl
Date: Tue, 18 Feb 2020 21:55:59 +0100	[thread overview]
Message-ID: <ec07688d-e058-84c6-7e40-99d0decdbb0f@vivier.eu> (raw)
In-Reply-To: <ebc00405-19f7-7b7e-a51c-dab761e5bb04@vivier.eu>

Le 18/02/2020 à 21:53, Laurent Vivier a écrit :
> Le 24/01/2020 à 16:47, Aleksandar Markovic a écrit :
>> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>>
>> FITRIM ioctl accepts a pointer to the structure
>>
>> struct fstrim_range {
>>     __u64 start;
>>     __u64 len;
>>     __u64 minlen;
>> };
>>
>> as its third argument.
>>
>> All ioctls in this group (FI* ioctl) are guarded with "#ifdef", so the
>> guards are used in this implementation too for consistency (however,
>> many of ioctls in FI* group became old enough that their #ifdef guards
>> could be removed, bit this is out of the scope of this patch).
>>
>> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
>> ---
>>  linux-user/ioctls.h        | 3 +++
>>  linux-user/syscall_defs.h  | 1 +
>>  linux-user/syscall_types.h | 5 +++++
>>  3 files changed, 9 insertions(+)
>>
>> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
>> index 9fb9d6f..944fbeb 100644
>> --- a/linux-user/ioctls.h
>> +++ b/linux-user/ioctls.h
>> @@ -152,6 +152,9 @@
>>  #ifdef FIBMAP
>>       IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
>>  #endif
>> +#ifdef FITRIM
>> +     IOCTL(FITRIM, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_fstrim_range)))
>> +#endif
>>  #ifdef FICLONE
>>       IOCTL(FICLONE, IOC_W, TYPE_INT)
>>       IOCTL(FICLONERANGE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_file_clone_range)))
>> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
>> index ed5068f..8761841 100644
>> --- a/linux-user/syscall_defs.h
>> +++ b/linux-user/syscall_defs.h
>> @@ -950,6 +950,7 @@ struct target_rtc_pll_info {
>>  #define TARGET_FIBMAP     TARGET_IO(0x00,1)  /* bmap access */
>>  #define TARGET_FIGETBSZ   TARGET_IO(0x00,2)  /* get the block size used for bmap */
>>  
>> +#define TARGET_FITRIM     TARGET_IOWR('X', 121, struct fstrim_range)

You need also the "#ifdef" that is in the next patch.

>>  #define TARGET_FICLONE    TARGET_IOW(0x94, 9, int)
>>  #define TARGET_FICLONERANGE TARGET_IOW(0x94, 13, struct file_clone_range)
>>  
>> diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
>> index 5ba4155..dfd7608 100644
>> --- a/linux-user/syscall_types.h
>> +++ b/linux-user/syscall_types.h
>> @@ -226,6 +226,11 @@ STRUCT(dm_target_versions,
>>  STRUCT(dm_target_msg,
>>         TYPE_ULONGLONG) /* sector */
>>  
>> +STRUCT(fstrim_range,
>> +       TYPE_LONGLONG, /* start */
>> +       TYPE_LONGLONG, /* len */
>> +       TYPE_LONGLONG) /* minlen */
> 
> they are __u64, use TYPE_ULONGLONG.
> 
> With that changed, you can add my:
> 
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> 
> 



  reply	other threads:[~2020-02-18 20:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 15:47 [PATCH v2 0/4] linux-user: Add support for fs and fd ioctls Aleksandar Markovic
2020-01-24 15:47 ` [PATCH v2 1/4] linux-user: Add support for FS_IOC_FS<GET|SET>XATTR ioctls Aleksandar Markovic
2020-02-18 20:47   ` Laurent Vivier
2020-01-24 15:47 ` [PATCH v2 2/4] linux-user: Add support for FITRIM ioctl Aleksandar Markovic
2020-02-18 20:53   ` Laurent Vivier
2020-02-18 20:55     ` Laurent Vivier [this message]
2020-01-24 15:47 ` [PATCH v2 3/4] linux-user: Add support for FIFREEZE and FITHAW ioctls Aleksandar Markovic
2020-02-18 21:13   ` Laurent Vivier
2020-01-24 15:47 ` [PATCH v2 4/4] linux-user: Add support for FDGETFDCSTAT ioctl Aleksandar Markovic
2020-02-18 21:18   ` Laurent Vivier

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=ec07688d-e058-84c6-7e40-99d0decdbb0f@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=aleksandar.markovic@rt-rk.com \
    --cc=amarkovic@wavecomp.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).