Commit 51409588 authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Tomasz Zawadzki
Browse files

ftl: utils



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


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
parent 769984a9
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ SO_MINOR := 0

CFLAGS += -I.

FTL_SUBDIRS := utils

C_SRCS = ftl_core.c

SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_ftl.map)
@@ -18,3 +20,14 @@ SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_ftl.map)
LIBNAME = ftl

include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk

# TODO: This should be handled by spdk.subdirs.mk
CLEAN_FTL_SUBDIRS = $(addprefix clean_ftl_, $(FTL_SUBDIRS))

clean: $(CLEAN_FTL_SUBDIRS)

.PHONY: $(CLEAN_FTL_SUBDIRS)
$(CLEAN_FTL_SUBDIRS): _Q := $(Q)
$(CLEAN_FTL_SUBDIRS): Q :=
$(CLEAN_FTL_SUBDIRS): clean_ftl_%:%
	$(_Q)cd $< && $(CLEAN_C)
+1 −0
Original line number Diff line number Diff line
@@ -13,5 +13,6 @@
#include "spdk/crc32.h"

#include "ftl_core.h"
#include "ftl_internal.h"

SPDK_LOG_REGISTER_COMPONENT(ftl_core)
+3 −1
Original line number Diff line number Diff line
@@ -15,7 +15,9 @@
#include "spdk/ftl.h"
#include "spdk/bdev.h"
#include "spdk/bdev_zone.h"
#include "spdk/log.h"

#include "ftl_internal.h"
#include "utils/ftl_log.h"

struct spdk_ftl_dev {
	/* Device instance */

lib/ftl/ftl_internal.h

0 → 100644
+23 −0
Original line number Diff line number Diff line
/*   SPDX-License-Identifier: BSD-3-Clause
 *   Copyright (c) Intel Corporation.
 *   All rights reserved.
 */

#ifndef FTL_INTERNAL_H
#define FTL_INTERNAL_H

#include "spdk/stdinc.h"
#include "spdk/crc32.h"
#include "spdk/util.h"
#include "spdk/uuid.h"

/* Marks address as invalid */
#define FTL_ADDR_INVALID	((ftl_addr)-1)

/*
 * This type represents address in the ftl address space. Values from 0 to based bdev size are
 * mapped directly to base device lbas. Values above that represent nv cache lbas.
 */
typedef uint64_t ftl_addr;

#endif /* FTL_INTERNAL_H */

lib/ftl/ftl_utils.h

0 → 100644
+11 −0
Original line number Diff line number Diff line
/*   SPDX-License-Identifier: BSD-3-Clause
 *   Copyright (c) Intel Corporation.
 *   All rights reserved.
 */

#ifndef FTL_FTL_UTILS_H
#define FTL_FTL_UTILS_H

#include "utils/ftl_defs.h"

#endif /* FTL_FTL_UTILS_H */
Loading