bdev: eliminate memset in spdk_bdev_get_io

Most relevant fields get initialized after the structure
is returned to the caller, so this memset is just
wasting CPU cycles.

buf still needs to be set to NULL, so just set that
field explicitly.

bdevperf with null backend shows a 10% improvement
with this patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I92ef0ea887f1307abdcd4b80bc08b45ccefe27d9

Reviewed-on: https://review.gerrithub.io/393714
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Jim Harris 2018-01-04 17:44:02 -07:00 committed by Daniel Verkamp
parent e4bfb3d153
commit 1ba93e61d4

View File

@ -753,8 +753,6 @@ spdk_bdev_get_io(struct spdk_io_channel *_ch)
}
}
memset(bdev_io, 0, offsetof(struct spdk_bdev_io, u));
return bdev_io;
}
@ -826,6 +824,7 @@ spdk_bdev_io_init(struct spdk_bdev_io *bdev_io,
bdev_io->cb = cb;
bdev_io->status = SPDK_BDEV_IO_STATUS_PENDING;
bdev_io->in_submit_request = false;
bdev_io->buf = NULL;
}
bool