2 * Copyright: Matias Bjorling <mb@bjorling.me>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License version
6 * 2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
18 #include <linux/module.h>
19 #include <linux/vmalloc.h>
21 #include <linux/lightnvm.h>
27 struct list_head area_list
;
30 struct list_head targets
;
33 /* Map between virtual and physical channel and lun */
41 struct gen_ch_map
*chnls
;
46 struct list_head list
;
48 sector_t end
; /* end is excluded */
51 static inline void *ch_map_to_lun_offs(struct gen_ch_map
*ch_map
)
56 typedef int (gen_trans_fn
)(struct nvm_tgt_dev
*, struct ppa_addr
*);
58 #define gen_for_each_lun(bm, lun, i) \
59 for ((i) = 0, lun = &(bm)->luns[0]; \
60 (i) < (bm)->nr_luns; (i)++, lun = &(bm)->luns[(i)])
62 #endif /* GENNVM_H_ */