mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Add wrapper for Linux BLKFLSBUF ioctl
FreeBSD has no analog. Buffered block devices were removed a decade plus ago. Reviewed-by: Igor Kozhukhov <igor@dilos.org> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9508
This commit is contained in:
committed by
Brian Behlendorf
parent
4a22ba5be0
commit
d46f0deb03
+1
-1
@@ -3444,7 +3444,7 @@ dump_label(const char *dev)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (S_ISBLK(statbuf.st_mode) && ioctl(fd, BLKFLSBUF) != 0)
|
||||
if (S_ISBLK(statbuf.st_mode) && zfs_dev_flush(fd) != 0)
|
||||
(void) printf("failed to invalidate cache '%s' : %s\n", path,
|
||||
strerror(errno));
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user