--- a/util-linux/blkdiscard.c	2024-10-22 18:37:23.524878302 +0200
+++ b/util-linux/blkdiscard.c	2024-10-22 18:39:46.472785246 +0200
@@ -56,15 +56,18 @@
 	uint64_t range[2];
 //	struct stat st;
 	int fd;
+	unsigned int ioctl_cmd;
+	const char *ioctl_cmd_str;
 
 	enum {
 		OPT_OFFSET = (1 << 0),
 		OPT_LENGTH = (1 << 1),
 		OPT_SECURE = (1 << 2),
+		OPT_ZERO   = (1 << 3),
 	};
 
 	opt_complementary = "=1";
-	opts = getopt32(argv, "o:l:s", &offset_str, &length_str);
+	opts = getopt32(argv, "o:l:sz", &offset_str, &length_str);
 	argv += optind;
 
 	fd = xopen(argv[0], O_RDWR|O_EXCL);
@@ -75,6 +78,17 @@
 
 	offset = xatoull_sfx(offset_str, kMG_suffixes);
 
+	if (opts & OPT_ZERO) {
+		ioctl_cmd = BLKZEROOUT;
+		ioctl_cmd_str = "BLKZEROOUT";
+	} else if (opts & OPT_SECURE) {
+		ioctl_cmd = BLKSECDISCARD;
+		ioctl_cmd_str = "BLKSECDISCARD";
+	} else {
+		ioctl_cmd = BLKDISCARD;
+		ioctl_cmd_str = "BLKDISCARD";
+	}
+
 	if (opts & OPT_LENGTH)
 		length = xatoull_sfx(length_str, kMG_suffixes);
 	else {
@@ -85,11 +102,11 @@
 	range[0] = offset;
 	range[1] = length;
 	ioctl_or_perror_and_die(fd,
-			(opts & OPT_SECURE) ? BLKSECDISCARD : BLKDISCARD,
+			ioctl_cmd,
 			&range,
 			"%s: %s failed",
 			argv[0],
-			(opts & OPT_SECURE) ? "BLKSECDISCARD" : "BLKDISCARD"
+			ioctl_cmd_str
 	);
 
 	if (ENABLE_FEATURE_CLEAN_UP)
