Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ade69e24 authored by Matias Bjørling's avatar Matias Bjørling Committed by Jens Axboe
Browse files

lightnvm: merge gennvm with core



For the first iteration of Open-Channel SSDs, it was anticipated that
there could be various media managers on top of an open-channel SSD,
such to allow vendors to plug in their own host-side FTLs, without the
media manager in between.

Now that an Open-Channel SSD is exposed as a traditional block device,
there is no longer a need for this. Therefore lets merge the gennvm code
with core and simplify the stack.

Signed-off-by: default avatarMatias Bjørling <matias@cnexlabs.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 400f73b2
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -26,15 +26,6 @@ config NVM_DEBUG

	It is required to create/remove targets without IOCTLs.

config NVM_GENNVM
	tristate "General Non-Volatile Memory Manager for Open-Channel SSDs"
	---help---
	Non-volatile memory media manager for Open-Channel SSDs that implements
	physical media metadata management and block provisioning API.

	This is the standard media manager for using Open-Channel SSDs, and
	required for targets to be instantiated.

config NVM_RRPC
	tristate "Round-robin Hybrid Open-Channel SSD target"
	---help---
+1 −2
Original line number Diff line number Diff line
@@ -2,6 +2,5 @@
# Makefile for Open-Channel SSDs.
#

obj-$(CONFIG_NVM)		:= core.o sysblk.o
obj-$(CONFIG_NVM_GENNVM) 	+= gennvm.o
obj-$(CONFIG_NVM)		:= core.o
obj-$(CONFIG_NVM_RRPC)		+= rrpc.o
+595 −191

File changed.

Preview size limit exceeded, changes collapsed.

drivers/lightnvm/gennvm.c

deleted100644 → 0
+0 −657

File deleted.

Preview size limit exceeded, changes collapsed.

drivers/lightnvm/gennvm.h

deleted100644 → 0
+0 −62
Original line number Diff line number Diff line
/*
 * Copyright: Matias Bjorling <mb@bjorling.me>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 */

#ifndef GENNVM_H_
#define GENNVM_H_

#include <linux/module.h>
#include <linux/vmalloc.h>

#include <linux/lightnvm.h>

struct gen_dev {
	struct nvm_dev *dev;

	int nr_luns;
	struct list_head area_list;

	struct mutex lock;
	struct list_head targets;
};

/* Map between virtual and physical channel and lun */
struct gen_ch_map {
	int ch_off;
	int nr_luns;
	int *lun_offs;
};

struct gen_dev_map {
	struct gen_ch_map *chnls;
	int nr_chnls;
};

struct gen_area {
	struct list_head list;
	sector_t begin;
	sector_t end;	/* end is excluded */
};

static inline void *ch_map_to_lun_offs(struct gen_ch_map *ch_map)
{
	return ch_map + 1;
}

typedef int (gen_trans_fn)(struct nvm_tgt_dev *, struct ppa_addr *);

#define gen_for_each_lun(bm, lun, i) \
		for ((i) = 0, lun = &(bm)->luns[0]; \
			(i) < (bm)->nr_luns; (i)++, lun = &(bm)->luns[(i)])

#endif /* GENNVM_H_ */
Loading