Commit c682c789 authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Konrad Sztyber
Browse files

FTL: Add FTL bdev module



Signed-off-by: default avatarKozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I8c40b96f0726d83d6a307e8b9a04b7c210b80255
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13299


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 17147949
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -103,6 +103,30 @@ void spdk_ftl_dev_get_attrs(const struct spdk_ftl_dev *dev, struct spdk_ftl_attr
 */
void spdk_ftl_dev_get_conf(const struct spdk_ftl_dev *dev, struct spdk_ftl_conf *conf);

/**
 * Obtain an I/O channel for the device.
 *
 * \param dev device
 *
 * \return A handle to the I/O channel or NULL on failure.
 */
struct spdk_io_channel *spdk_ftl_get_io_channel(struct spdk_ftl_dev *dev);

/**
 * Make a deep copy of an FTL configuration structure
 *
 * \param dst The destination FTL configuration
 * \param src The source FTL configuration
 */
int spdk_ftl_conf_copy(struct spdk_ftl_conf *dst, const struct spdk_ftl_conf *src);

/**
 * Release the FTL configuration resources. This does not free the structure itself.
 *
 * \param conf FTL configuration to deinitialize
 */
void spdk_ftl_conf_deinit(struct spdk_ftl_conf *conf);

/**
 * Initialize FTL configuration structure with default values.
 *
+6 −0
Original line number Diff line number Diff line
@@ -55,4 +55,10 @@ ftl_core_poller(void *ctx)
	return SPDK_POLLER_IDLE;
}

struct spdk_io_channel *
spdk_ftl_get_io_channel(struct spdk_ftl_dev *dev)
{
	return spdk_get_io_channel(dev);
}

SPDK_LOG_REGISTER_COMPONENT(ftl_core)
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ free_dev(struct spdk_ftl_dev *dev)
	}

	deinit_core_thread(dev);
	ftl_conf_deinit(&dev->conf);
	spdk_ftl_conf_deinit(&dev->conf);
	free(dev);
}

+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@
	spdk_ftl_get_default_conf;
	spdk_ftl_dev_get_attrs;
	spdk_ftl_dev_get_conf;
	spdk_ftl_conf_copy;
	spdk_ftl_conf_deinit;
	spdk_ftl_get_io_channel;

	local: *;
};
+3 −3
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ spdk_ftl_dev_get_conf(const struct spdk_ftl_dev *dev, struct spdk_ftl_conf *conf
}

int
ftl_conf_cpy(struct spdk_ftl_conf *dst, const struct spdk_ftl_conf *src)
spdk_ftl_conf_copy(struct spdk_ftl_conf *dst, const struct spdk_ftl_conf *src)
{
	char *name = NULL;
	char *core_mask = NULL;
@@ -74,7 +74,7 @@ error:
}

void
ftl_conf_deinit(struct spdk_ftl_conf *conf)
spdk_ftl_conf_deinit(struct spdk_ftl_conf *conf)
{
	free(conf->name);
	free(conf->core_mask);
@@ -100,7 +100,7 @@ ftl_conf_init_dev(struct spdk_ftl_dev *dev, const struct spdk_ftl_conf *conf)
		return -EINVAL;
	}

	rc = ftl_conf_cpy(&dev->conf, conf);
	rc = spdk_ftl_conf_copy(&dev->conf, conf);
	if (rc) {
		return rc;
	}
Loading