From ccd1e177ee197e5c17f9eada546a42941517cb29 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 12 Mar 2018 09:43:38 -0700 Subject: [PATCH] Linux: Add support for the BLKFLSBUF ioctl --- NEWS | 1 + coregrind/m_syswrap/syswrap-linux.c | 4 ++++ include/vki/vki-linux.h | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index bbcb9625e..375751b3e 100644 --- a/NEWS +++ b/NEWS @@ -96,6 +96,7 @@ where XXXXXX is the bug number as listed below. n-i-bz Fix missing workq_ops operations (macOS) n-i-bz fix bug in strspn replacement +n-i-bz Add support for the Linux BLKFLSBUF ioctl Release 3.13.0 (15 June 2017) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 4120c1d09..beb9dff6b 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -6886,6 +6886,8 @@ PRE(sys_ioctl) case VKI_BLKGETSIZE: PRE_MEM_WRITE( "ioctl(BLKGETSIZE)", ARG3, sizeof(unsigned long)); break; + case VKI_BLKFLSBUF: + break; case VKI_BLKRASET: break; case VKI_BLKRAGET: @@ -9638,6 +9640,8 @@ POST(sys_ioctl) case VKI_BLKGETSIZE: POST_MEM_WRITE(ARG3, sizeof(unsigned long)); break; + case VKI_BLKFLSBUF: + break; case VKI_BLKRASET: break; case VKI_BLKRAGET: diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index faacf7fb3..cfec2350b 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -1775,18 +1775,23 @@ struct vki_ppdev_frob_struct { #define VKI_BLKROSET _VKI_IO(0x12,93) /* set device read-only (0 = read-write) */ #define VKI_BLKROGET _VKI_IO(0x12,94) /* get read-only status (0 = read_write) */ +#define VKI_BLKRRPART _VKI_IO(0x12,95) /* re-read partition table */ #define VKI_BLKGETSIZE _VKI_IO(0x12,96) /* return device size /512 (long *arg) */ +#define VKI_BLKFLSBUF _VKI_IO(0x12,97) /* flush buffer cache */ #define VKI_BLKRASET _VKI_IO(0x12,98) /* set read ahead for block device */ #define VKI_BLKRAGET _VKI_IO(0x12,99) /* get current read ahead setting */ #define VKI_BLKFRASET _VKI_IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */ #define VKI_BLKFRAGET _VKI_IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */ +#define VKI_BLKSECTSET _VKI_IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */ #define VKI_BLKSECTGET _VKI_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */ #define VKI_BLKSSZGET _VKI_IO(0x12,104)/* get block device sector size */ #define VKI_BLKBSZGET _VKI_IOR(0x12,112,vki_size_t) #define VKI_BLKBSZSET _VKI_IOW(0x12,113,vki_size_t) #define VKI_BLKGETSIZE64 _VKI_IOR(0x12,114,vki_size_t) /* return device size in bytes (u64 *arg) */ +#define VKI_BLKDISCARD _VKI_IO(0x12,119) #define VKI_BLKPBSZGET _VKI_IO(0x12,123) #define VKI_BLKDISCARDZEROES _VKI_IO(0x12,124) +#define VKI_BLKZEROOUT _VKI_IO(0x12,127) #define VKI_FIBMAP _VKI_IO(0x00,1) /* bmap access */ #define VKI_FIGETBSZ _VKI_IO(0x00,2) /* get the block size used for bmap */ -- 2.11.4.GIT