summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/btt.h
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2017-08-30 19:35:59 -0600
committerDan Williams <dan.j.williams@intel.com>2017-08-31 15:05:10 -0700
commit0595d539a5deb4f495618ebbed96db59ae635e32 (patch)
tree0c5930eff3470fc56261075a15da25e56af3688b /drivers/nvdimm/btt.h
parent1db1f3cea1d8886c686832d4618b346ae16c03c8 (diff)
libnvdimm, btt: refactor map entry operations with macros
Add helpers for converting a raw map entry to just the block number, or either of the 'e' or 'z' flags in preparation for actually using the error flag to mark blocks with media errors. Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/btt.h')
-rw-r--r--drivers/nvdimm/btt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/nvdimm/btt.h b/drivers/nvdimm/btt.h
index 888e862907a0..09fabf5a5590 100644
--- a/drivers/nvdimm/btt.h
+++ b/drivers/nvdimm/btt.h
@@ -38,6 +38,10 @@
#define IB_FLAG_ERROR 0x00000001
#define IB_FLAG_ERROR_MASK 0x00000001
+#define ent_lba(ent) (ent & MAP_LBA_MASK)
+#define ent_e_flag(ent) (!!(ent & MAP_ERR_MASK))
+#define ent_z_flag(ent) (!!(ent & MAP_TRIM_MASK))
+
enum btt_init_state {
INIT_UNCHECKED = 0,
INIT_NOTFOUND,