summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
767d137)
Clarify the execution context of zbd_init() by renaming this function
to zbd_setup_files() as it is called from the setup_files() function.
While at it, wrap the use of zbd_free_zone_info() into the inline
function zbd_close_file() to avoid an unecessary function call when
closing files that are not zoned block device files of zonemode=zbd
jobs, that is, files that do not have zbd_info initialized.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
td_restore_runstate(td, old_state);
if (td->o.zone_mode == ZONE_MODE_ZBD) {
td_restore_runstate(td, old_state);
if (td->o.zone_mode == ZONE_MODE_ZBD) {
+ err = zbd_setup_files(td);
td_io_unlink_file(td, f);
}
td_io_unlink_file(td, f);
}
if (use_free)
free(f->file_name);
if (use_free)
free(f->file_name);
- if (!f->zbd_info)
- return;
pthread_mutex_lock(&f->zbd_info->mutex);
refcount = --f->zbd_info->refcount;
pthread_mutex_lock(&f->zbd_info->mutex);
refcount = --f->zbd_info->refcount;
-int zbd_init(struct thread_data *td)
+int zbd_setup_files(struct thread_data *td)
{
struct fio_file *f;
int i;
{
struct fio_file *f;
int i;
struct fio_zone_info zone_info[0];
};
struct fio_zone_info zone_info[0];
};
+int zbd_setup_files(struct thread_data *td);
void zbd_free_zone_info(struct fio_file *f);
void zbd_free_zone_info(struct fio_file *f);
-int zbd_init(struct thread_data *td);
void zbd_file_reset(struct thread_data *td, struct fio_file *f);
bool zbd_unaligned_write(int error_code);
void setup_zbd_zone_mode(struct thread_data *td, struct io_u *io_u);
void zbd_file_reset(struct thread_data *td, struct fio_file *f);
bool zbd_unaligned_write(int error_code);
void setup_zbd_zone_mode(struct thread_data *td, struct io_u *io_u);
enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u);
char *zbd_write_status(const struct thread_stat *ts);
enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u);
char *zbd_write_status(const struct thread_stat *ts);
+static inline void zbd_close_file(struct fio_file *f)
+{
+ if (f->zbd_info)
+ zbd_free_zone_info(f);
+}
+
static inline void zbd_queue_io_u(struct io_u *io_u, enum fio_q_status status)
{
if (io_u->zbd_queue_io) {
static inline void zbd_queue_io_u(struct io_u *io_u, enum fio_q_status status)
{
if (io_u->zbd_queue_io) {