aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zpool
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-10-28 09:53:39 -0700
committerBrian Behlendorf <[email protected]>2019-10-28 09:53:39 -0700
commitd46f0deb035bd26840dc6284fc6e1bb392097c92 (patch)
tree35cb36d78d2e4b67a14c43a30c739453ea37888b /cmd/zpool
parent4a22ba5be0aab1480aeac4581025ce6d7ce4b4a1 (diff)
Add wrapper for Linux BLKFLSBUF ioctl
FreeBSD has no analog. Buffered block devices were removed a decade plus ago. Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9508
Diffstat (limited to 'cmd/zpool')
-rw-r--r--cmd/zpool/zpool_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 6071babfd..0ac8c2a5e 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -1178,7 +1178,7 @@ zpool_do_labelclear(int argc, char **argv)
* fatal when the device does not support BLKFLSBUF as would be the
* case for a file vdev.
*/
- if ((ioctl(fd, BLKFLSBUF) != 0) && (errno != ENOTTY))
+ if ((zfs_dev_flush(fd) != 0) && (errno != ENOTTY))
(void) fprintf(stderr, gettext("failed to invalidate "
"cache for %s: %s\n"), vdev, strerror(errno));