* [PATCH] linux-user: Add FITRIM ioctl
@ 2024-04-03 9:20 Michael Vogt
2024-04-05 22:41 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Michael Vogt @ 2024-04-03 9:20 UTC (permalink / raw)
To: qemu-devel, richard.henderson; +Cc: Michael Vogt
From: Michael Vogt <mvogt@redhat.com>
Tiny patch to add the missing FITRIM ioctl.
Signed-off-by: Michael Vogt <mvogt@redhat.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 1aec9d5836..d508d0c04a 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -140,6 +140,9 @@
#ifdef FITHAW
IOCTL(FITHAW, IOC_W | IOC_R, TYPE_INT)
#endif
+#ifdef FITRIM
+ IOCTL(FITRIM, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_fstrim_range)))
+#endif
IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG))
#ifdef CONFIG_FIEMAP
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 744fda599e..ce0adb706e 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -945,6 +945,7 @@ struct target_rtc_pll_info {
#define TARGET_FIFREEZE TARGET_IOWR('X', 119, abi_int)
#define TARGET_FITHAW TARGET_IOWR('X', 120, abi_int)
+#define TARGET_FITRIM TARGET_IOWR('X', 121, struct fstrim_range)
/*
* Note that the ioctl numbers for FS_IOC_<GET|SET><FLAGS|VERSION>
diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
index c3b43f8022..6dd7a80ce5 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -341,6 +341,11 @@ STRUCT(file_clone_range,
TYPE_ULONGLONG, /* src_length */
TYPE_ULONGLONG) /* dest_offset */
+STRUCT(fstrim_range,
+ TYPE_ULONGLONG, /* start */
+ TYPE_ULONGLONG, /* len */
+ TYPE_ULONGLONG) /* minlen */
+
STRUCT(fiemap_extent,
TYPE_ULONGLONG, /* fe_logical */
TYPE_ULONGLONG, /* fe_physical */
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] linux-user: Add FITRIM ioctl
2024-04-03 9:20 [PATCH] linux-user: Add FITRIM ioctl Michael Vogt
@ 2024-04-05 22:41 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2024-04-05 22:41 UTC (permalink / raw)
To: Michael Vogt, qemu-devel; +Cc: Michael Vogt
On 4/2/24 23:20, Michael Vogt wrote:
> From: Michael Vogt <mvogt@redhat.com>
>
> Tiny patch to add the missing FITRIM ioctl.
>
> Signed-off-by: Michael Vogt <mvogt@redhat.com>
> ---
> linux-user/ioctls.h | 3 +++
> linux-user/syscall_defs.h | 1 +
> linux-user/syscall_types.h | 5 +++++
> 3 files changed, 9 insertions(+)
Thanks, queued.
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-05 22:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-03 9:20 [PATCH] linux-user: Add FITRIM ioctl Michael Vogt
2024-04-05 22:41 ` Richard Henderson
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).