Commit 3e54a5bb authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

bdev: rearrange bdev_module.h



Move some of the bdev_module APIs immediately after
the bdev_module structure definition.  This prepares
for an upcoming patch.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I78d534ba047048ec27d8d3159666584a52211de3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7736


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent bc7da854
Loading
Loading
Loading
Loading
+22 −22
Original line number Diff line number Diff line
@@ -161,6 +161,28 @@ struct spdk_bdev_module {
	} internal;
};

/**
 * Called by a bdev module to lay exclusive write claim to a bdev.
 *
 * Also upgrades that bdev's descriptor to have write access.
 *
 * \param bdev Block device to be claimed.
 * \param desc Descriptor for the above block device.
 * \param module Bdev module attempting to claim bdev.
 *
 * \return 0 on success
 * \return -EPERM if the bdev is already claimed by another module.
 */
int spdk_bdev_module_claim_bdev(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc,
				struct spdk_bdev_module *module);

/**
 * Called to release a write claim on a block device.
 *
 * \param bdev Block device to be released.
 */
void spdk_bdev_module_release_bdev(struct spdk_bdev *bdev);

typedef void (*spdk_bdev_unregister_cb)(void *cb_arg, int rc);

/**
@@ -766,28 +788,6 @@ void spdk_bdev_module_init_done(struct spdk_bdev_module *module);
 */
void spdk_bdev_module_finish_done(void);

/**
 * Called by a bdev module to lay exclusive write claim to a bdev.
 *
 * Also upgrades that bdev's descriptor to have write access.
 *
 * \param bdev Block device to be claimed.
 * \param desc Descriptor for the above block device.
 * \param module Bdev module attempting to claim bdev.
 *
 * \return 0 on success
 * \return -EPERM if the bdev is already claimed by another module.
 */
int spdk_bdev_module_claim_bdev(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc,
				struct spdk_bdev_module *module);

/**
 * Called to release a write claim on a block device.
 *
 * \param bdev Block device to be released.
 */
void spdk_bdev_module_release_bdev(struct spdk_bdev *bdev);

/**
 * Add alias to block device names list.
 * Aliases can be add only to registered bdev.