]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user: Add FITRIM ioctl
authorMichael Vogt <mvogt@redhat.com>
Wed, 3 Apr 2024 09:20:49 +0000 (11:20 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 24 Apr 2024 22:46:00 +0000 (15:46 -0700)
Tiny patch to add the missing FITRIM ioctl.

Signed-off-by: Michael Vogt <mvogt@redhat.com>
Message-Id: <20240403092048.16023-2-michael.vogt@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/ioctls.h
linux-user/syscall_defs.h
linux-user/syscall_types.h

index 1aec9d5836821df8b209945b169649fc8562e542..d508d0c04a7e5ca086c9b1ebdcf091b0ff3f4faf 100644 (file)
 #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
index 3995487630f0cc6190eada990102f23b36ba3f26..a00b617cae8c0254606587f1deb9433a139dec17 100644 (file)
@@ -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>
index c3b43f80223a9e3f5e028f5f88210067dfe20387..6dd7a80ce5497aa34d931b531ff1beddce0d228b 100644 (file)
@@ -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 */