From 7854ada85dafe2ff6684fbb93e973f91283d99fc Mon Sep 17 00:00:00 2001 From: Dan Ehrenberg Date: Tue, 14 Apr 2015 15:58:14 -0700 Subject: [PATCH] Allow trim on any file type The mtd fio engine will support trim (interpreted as erase). There is no particular reason to tie trims to block devices, as it is only a particular ioengine which calls the trim ioctl, not generic code. This patch simply removes the test which checks that trim is only run on block devices. Signed-off-by: Dan Ehrenberg Signed-off-by: Jens Axboe --- filesetup.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/filesetup.c b/filesetup.c index 09e877f6..79e5df13 100644 --- a/filesetup.c +++ b/filesetup.c @@ -512,11 +512,6 @@ int generic_open_file(struct thread_data *td, struct fio_file *f) dprint(FD_FILE, "fd open %s\n", f->file_name); - if (td_trim(td) && f->filetype != FIO_TYPE_BD) { - log_err("fio: trim only applies to block device\n"); - return 1; - } - if (!strcmp(f->file_name, "-")) { if (td_rw(td)) { log_err("fio: can't read/write to stdin/out\n"); -- 2.25.1