[PATCH 07/12] oslib: remove blkzoned_finish_zone()
Shin'ichiro Kawasaki <[email protected]> Fri, 9 Jan 2026 11:35:58 +0900
| Newsgroups | org.kernel.vger.fio |
|---|---|
| Message-ID | <[email protected]> |
Zone finish operation is no longer required, then the function blkzoned_finish_zone() is not required either. Remove it. Signed-off-by: Shin'ichiro Kawasaki <[email protected]> --- oslib/blkzoned.h | 8 -------- oslib/linux-blkzoned.c | 34 ---------------------------------- 2 files changed, 42 deletions(-) diff --git a/oslib/blkzoned.h b/oslib/blkzoned.h index a8e4a948..c6549ecb 100644 --- a/oslib/blkzoned.h +++ b/oslib/blkzoned.h @@ -24,8 +24,6 @@ extern int blkzoned_get_max_open_zones(struct thread_data *td, struct fio_file * extern int blkzoned_get_max_active_zones(struct thread_data *td, struct fio_file *f, unsigned int *max_active_zones); -extern int blkzoned_finish_zone(struct thread_data *td, struct fio_file *f, - uint64_t offset, uint64_t length); #else /* * Define stubs for systems that do not have zoned block device support. @@ -71,12 +69,6 @@ static inline int blkzoned_get_max_active_zones(struct thread_data *td, { return -EIO; } -static inline int blkzoned_finish_zone(struct thread_data *td, - struct fio_file *f, - uint64_t offset, uint64_t length) -{ - return -EIO; -} #endif #endif /* FIO_BLKZONED_H */ diff --git a/oslib/linux-blkzoned.c b/oslib/linux-blkzoned.c index c45ef623..34ac66ce 100644 --- a/oslib/linux-blkzoned.c +++ b/oslib/linux-blkzoned.c @@ -338,40 +338,6 @@ int blkzoned_reset_wp(struct thread_data *td, struct fio_file *f, return ret; } -int blkzoned_finish_zone(struct thread_data *td, struct fio_file *f, - uint64_t offset, uint64_t length) -{ - struct blk_zone_range zr = { - .sector = offset >> 9, - .nr_sectors = length >> 9, - }; - int fd, ret = 0; - - /* If the file is not yet opened, open it for this function. */ - fd = f->fd; - if (fd < 0) { - fd = open(f->file_name, O_RDWR | O_LARGEFILE); - if (fd < 0) - return -errno; - } - - if (ioctl(fd, BLKFINISHZONE, &zr) < 0) { - ret = -errno; - /* - * Kernel versions older than 5.5 do not support BLKFINISHZONE - * and return the ENOTTY error code. These old kernels only - * support block devices that close zones automatically. - */ - if (ret == ENOTTY) - ret = 0; - } - - if (f->fd < 0) - close(fd); - - return ret; -} - int blkzoned_move_zone_wp(struct thread_data *td, struct fio_file *f, struct zbd_zone *z, uint64_t length, const char *buf) { -- 2.49.0