module/raid: move a single function up
In prep for future RAID1E patch so that the completion function can be shared by multiple RAID levels. Change-Id: I169e2d64388fab701e9b467f8803aacd5d1250d2 Signed-off-by: paul luse <paul.e.luse@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469743 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
75cb691c97
commit
a5d9d77821
@ -282,6 +282,34 @@ raid_bdev_io_completion(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* brief:
|
||||
* raid_bdev_base_io_completion is the completion callback for member disk requests
|
||||
* params:
|
||||
* bdev_io - pointer to member disk requested bdev_io
|
||||
* success - true if successful, false if unsuccessful
|
||||
* cb_arg - callback argument (parent raid bdev_io)
|
||||
* returns:
|
||||
* none
|
||||
*/
|
||||
static void
|
||||
raid_bdev_base_io_completion(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg)
|
||||
{
|
||||
struct spdk_bdev_io *parent_io = cb_arg;
|
||||
struct raid_bdev_io *raid_io = (struct raid_bdev_io *)parent_io->driver_ctx;
|
||||
|
||||
spdk_bdev_free_io(bdev_io);
|
||||
|
||||
if (!success) {
|
||||
raid_io->base_bdev_io_status = SPDK_BDEV_IO_STATUS_FAILED;
|
||||
}
|
||||
|
||||
raid_io->base_bdev_io_completed++;
|
||||
if (raid_io->base_bdev_io_completed == raid_io->base_bdev_io_expected) {
|
||||
spdk_bdev_io_complete(parent_io, raid_io->base_bdev_io_status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* brief:
|
||||
* raid0_submit_rw_request function is used to submit I/O to the correct
|
||||
@ -471,34 +499,6 @@ raid0_start_rw_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* brief:
|
||||
* raid_bdev_base_io_completion is the completion callback for member disk requests
|
||||
* params:
|
||||
* bdev_io - pointer to member disk requested bdev_io
|
||||
* success - true if successful, false if unsuccessful
|
||||
* cb_arg - callback argument (parent raid bdev_io)
|
||||
* returns:
|
||||
* none
|
||||
*/
|
||||
static void
|
||||
raid_bdev_base_io_completion(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg)
|
||||
{
|
||||
struct spdk_bdev_io *parent_io = cb_arg;
|
||||
struct raid_bdev_io *raid_io = (struct raid_bdev_io *)parent_io->driver_ctx;
|
||||
|
||||
spdk_bdev_free_io(bdev_io);
|
||||
|
||||
if (!success) {
|
||||
raid_io->base_bdev_io_status = SPDK_BDEV_IO_STATUS_FAILED;
|
||||
}
|
||||
|
||||
raid_io->base_bdev_io_completed++;
|
||||
if (raid_io->base_bdev_io_completed == raid_io->base_bdev_io_expected) {
|
||||
spdk_bdev_io_complete(parent_io, raid_io->base_bdev_io_status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* brief:
|
||||
* raid_bdev_base_io_submit_fail_process processes IO requests for member disk
|
||||
|
Loading…
Reference in New Issue
Block a user