summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/pblk.h
diff options
context:
space:
mode:
authorJavier González <javier@cnexlabs.com>2017-10-13 14:46:19 +0200
committerJens Axboe <axboe@kernel.dk>2017-10-13 16:34:57 +0200
commite2cddf2082e700218b898b1c899f6a1c2130074a (patch)
tree8f9344e2d99c95c47f48d068f60c1b7de5495d05 /drivers/lightnvm/pblk.h
parentlightnvm: pblk: allocate bio size more accurately (diff)
downloadlinux-e2cddf2082e700218b898b1c899f6a1c2130074a.tar.xz
linux-e2cddf2082e700218b898b1c899f6a1c2130074a.zip
lightnvm: pblk: improve naming for internal req.
Each request type sent to the LightNVM subsystem requires different metadata. Until now, we have tailored this metadata based on write, read and erase commands. However, pblk uses different metadata for internal writes that do not hit the write buffer. Instead of abusing the metadata for reads, create a new request type - internal write to improve code readability. In the process, create internal values for each I/O type instead of abusing the READ/WRITE macros, as suggested by Christoph. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--drivers/lightnvm/pblk.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index 9f162057d497..d01e003d3d74 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -55,12 +55,17 @@
for ((i) = 0, rlun = &(pblk)->luns[0]; \
(i) < (pblk)->nr_luns; (i)++, rlun = &(pblk)->luns[(i)])
-#define ERASE 2 /* READ = 0, WRITE = 1 */
-
/* Static pool sizes */
#define PBLK_GEN_WS_POOL_SIZE (2)
enum {
+ PBLK_READ = READ,
+ PBLK_WRITE = WRITE,/* Write from write buffer */
+ PBLK_WRITE_INT, /* Internal write - no write buffer */
+ PBLK_ERASE,
+};
+
+enum {
/* IO Types */
PBLK_IOTYPE_USER = 1 << 0,
PBLK_IOTYPE_GC = 1 << 1,
@@ -1132,7 +1137,7 @@ static inline int pblk_set_progr_mode(struct pblk *pblk, int type)
flags = geo->plane_mode >> 1;
- if (type == WRITE)
+ if (type == PBLK_WRITE)
flags |= NVM_IO_SCRAMBLE_ENABLE;
return flags;