ftl: Added initialization module
This patch adds OCSSD device initialization consisting of the following: * retrieving SSD's geometry and its state * verifying configuration * initializing core structures (L2P, bands, write buffer, write pointers, bad block tables, etc) * initializing threads Change-Id: Ieb643f78035702e834b9ef7830a3db215e35bfb7 Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Signed-off-by: Jakub Radtke <jakub.radtke@intel.com> Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/431326 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
8b9ccc1419
commit
5c3591c72e
@ -72,9 +72,6 @@ struct spdk_ftl_conf {
|
||||
/* Trace enabled flag */
|
||||
int trace;
|
||||
|
||||
/* Trace file name */
|
||||
const char *trace_path;
|
||||
|
||||
/* Maximum IO depth per band relocate */
|
||||
size_t max_reloc_qdepth;
|
||||
|
||||
|
@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
|
||||
C_SRCS = ftl_band.c ftl_core.c ftl_debug.c ftl_io.c ftl_rwb.c ftl_reloc.c \
|
||||
ftl_anm.c ftl_restore.c
|
||||
ftl_anm.c ftl_restore.c ftl_init.c
|
||||
|
||||
LIBNAME = ftl
|
||||
|
||||
|
@ -321,13 +321,13 @@ _ftl_io_erase(void *ctx)
|
||||
static bool
|
||||
ftl_check_core_thread(const struct spdk_ftl_dev *dev)
|
||||
{
|
||||
return dev->core_thread.tid == pthread_self();
|
||||
return dev->core_thread.thread == spdk_get_thread();
|
||||
}
|
||||
|
||||
static bool
|
||||
ftl_check_read_thread(const struct spdk_ftl_dev *dev)
|
||||
{
|
||||
return dev->read_thread.tid == pthread_self();
|
||||
return dev->read_thread.thread == spdk_get_thread();
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -86,8 +86,6 @@ struct ftl_thread {
|
||||
|
||||
/* Thread on which the poller is running */
|
||||
struct spdk_thread *thread;
|
||||
/* Thread id */
|
||||
pthread_t tid;
|
||||
|
||||
/* Poller */
|
||||
struct spdk_poller *poller;
|
||||
|
1055
lib/ftl/ftl_init.c
Normal file
1055
lib/ftl/ftl_init.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -106,6 +106,8 @@ void ftl_trace_limits(struct ftl_trace *trace, const size_t *limits, size_t num_
|
||||
#else
|
||||
#define ftl_trace(fn, trace, ...)
|
||||
#define ftl_trace_alloc_group(trace) FTL_TRACE_INVALID_ID
|
||||
#define ftl_trace_init() NULL
|
||||
#define ftl_trace_free(t)
|
||||
#endif
|
||||
|
||||
#endif /* FTL_TRACE_H */
|
||||
|
Loading…
Reference in New Issue
Block a user