fellow_cache: Assert that fcs->len is not used by FCO segments

parent 880be3b6
...@@ -1415,7 +1415,11 @@ assert_cache_seg_consistency(const struct fellow_cache_seg *fcs) ...@@ -1415,7 +1415,11 @@ assert_cache_seg_consistency(const struct fellow_cache_seg *fcs)
AZ(fcs->alloc.size); \ AZ(fcs->alloc.size); \
AZ(fcs->len); \ AZ(fcs->len); \
} while(0) } while(0)
#define FCOSA_MEM do { \ #define FCSA_MEM do { \
AN(fcs->alloc.ptr); \
AN(fcs->alloc.size); \
} while(0)
#define FCOA_MEM do { \
AN(fcs->alloc.ptr); \ AN(fcs->alloc.ptr); \
AN(fcs->alloc.size); \ AN(fcs->alloc.size); \
} while(0) } while(0)
...@@ -1453,7 +1457,8 @@ assert_cache_seg_consistency(const struct fellow_cache_seg *fcs) ...@@ -1453,7 +1457,8 @@ assert_cache_seg_consistency(const struct fellow_cache_seg *fcs)
#undef FCOSA_NOFDB #undef FCOSA_NOFDB
#undef FCOSA_FDB #undef FCOSA_FDB
#undef FCOSA_NOMEM #undef FCOSA_NOMEM
#undef FCOSA_MEM #undef FCOA_MEM
#undef FCSA_MEM
#undef FDSA_NULL #undef FDSA_NULL
#undef FDSA_UN #undef FDSA_UN
#undef FDSA_ALLOC #undef FDSA_ALLOC
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* FCOSA_MAYFDB * FCOSA_MAYFDB
* *
* FCOSA_NOMEM * FCOSA_NOMEM
* FCOSA_MEM * FCOA_MEM
* *
* diskset: FDSA_NULL no disk_seg pointer * diskset: FDSA_NULL no disk_seg pointer
* FDSA_MAY NULL or valid object (for READFAIL) * FDSA_MAY NULL or valid object (for READFAIL)
...@@ -42,18 +42,18 @@ ...@@ -42,18 +42,18 @@
FCOSD(FCO, INIT, "unused", FCOSD(FCO, INIT, "unused",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_NOMEM, FDSA_NULL) FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_NOMEM, FDSA_NULL)
FCOSD(FCO, BUSY, "in memory, incomplete", FCOSD(FCO, BUSY, "in memory, incomplete",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_NOFDB, FCOA_MEM, FDSA_ALLOC)
FCOSD(FCO, WRITING, "transitioning BUSY->INCORE, being written", FCOSD(FCO, WRITING, "transitioning BUSY->INCORE, being written",
FCOSA_NOLRU, FCOSA_MAYFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_MAYFDB, FCOA_MEM, FDSA_ALLOC)
FCOSD(FCO, READING, "being read, signal via cond", FCOSD(FCO, READING, "being read, signal via cond",
FCOSA_NOLRU, FCOSA_MAYFDB, FCOSA_MEM, FDSA_NULL) FCOSA_NOLRU, FCOSA_MAYFDB, FCOA_MEM, FDSA_NULL)
FCOSD(FCO, REDUNDANT,"aborted read", FCOSD(FCO, REDUNDANT,"aborted read",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_NULL) FCOSA_NOLRU, FCOSA_NOFDB, FCOA_MEM, FDSA_NULL)
FCOSD(FCO, MEM, "only in mem, on lru unless a private object", FCOSD(FCO, MEM, "only in mem, on lru unless a private object",
FCOSA_MAYLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_UN) FCOSA_MAYLRU, FCOSA_NOFDB, FCOA_MEM, FDSA_UN)
FCOSD(FCO, INCORE, "usable in mem, on lru unless a private object", FCOSD(FCO, INCORE, "usable in mem, on lru unless a private object",
FCOSA_MAYLRU, FCOSA_MAYFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_MAYLRU, FCOSA_MAYFDB, FCOA_MEM, FDSA_ALLOC)
FCOSD(FCO, READFAIL, "read/write error", FCOSD(FCO, READFAIL, "read/write error",
FCOSA_NOLRU, FCOSA_MAYFDB, FCOSA_MEM, FDSA_MAY) FCOSA_NOLRU, FCOSA_MAYFDB, FCOA_MEM, FDSA_MAY)
FCOSD(FCO, EVICT, "only for obj, not on LRU", FCOSD(FCO, EVICT, "only for obj, not on LRU",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_MAY) FCOSA_NOLRU, FCOSA_NOFDB, FCOA_MEM, FDSA_MAY)
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* FCOSA_FDB * FCOSA_FDB
* *
* FCOSA_NOMEM * FCOSA_NOMEM
* FCOSA_MEM * FCSA_MEM
* *
* diskset: FDSA_NULL no disk_seg pointer * diskset: FDSA_NULL no disk_seg pointer
* FDSA_UN disk seg off/sz = 0 * FDSA_UN disk seg off/sz = 0
...@@ -43,18 +43,18 @@ FCOSD(FCS, INIT, "unused", ...@@ -43,18 +43,18 @@ FCOSD(FCS, INIT, "unused",
FCOSD(FCS, USABLE, "has an fds associated", FCOSD(FCS, USABLE, "has an fds associated",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_NOMEM, FDSA_UN) FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_NOMEM, FDSA_UN)
FCOSD(FCS, BUSY, "in memory, incomplete", FCOSD(FCS, BUSY, "in memory, incomplete",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_NOFDB, FCSA_MEM, FDSA_ALLOC)
FCOSD(FCS, WRITING, "transitioning BUSY->INCORE, being written", FCOSD(FCS, WRITING, "transitioning BUSY->INCORE, being written",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_NOFDB, FCSA_MEM, FDSA_ALLOC)
FCOSD(FCS, DISK, "can be fetched, off/sz filled, mem not alloced", FCOSD(FCS, DISK, "can be fetched, off/sz filled, mem not alloced",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_NOMEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_NOMEM, FDSA_ALLOC)
FCOSD(FCS, READING, "being read, signal via cond", FCOSD(FCS, READING, "being read, signal via cond",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_NOFDB, FCSA_MEM, FDSA_ALLOC)
FCOSD(FCS, CHECK, "in mem, needs to be checked", FCOSD(FCS, CHECK, "in mem, needs to be checked",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_NOFDB, FCSA_MEM, FDSA_ALLOC)
FCOSD(FCS, INCORE, "usable in mem, on lru if refcnt == 0", FCOSD(FCS, INCORE, "usable in mem, on lru if refcnt == 0",
FCOSA_MAYLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_MAYLRU, FCOSA_NOFDB, FCSA_MEM, FDSA_ALLOC)
FCOSD(FCS, MEM, "only in mem, not on lru (only the fco is on lru)", FCOSD(FCS, MEM, "only in mem, not on lru (only the fco is on lru)",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_UN) FCOSA_NOLRU, FCOSA_NOFDB, FCSA_MEM, FDSA_UN)
FCOSD(FCS, READFAIL, "only for obj, not on LRU", FCOSD(FCS, READFAIL, "only for obj, not on LRU",
FCOSA_NOLRU, FCOSA_NOFDB, FCOSA_MEM, FDSA_ALLOC) FCOSA_NOLRU, FCOSA_NOFDB, FCSA_MEM, FDSA_ALLOC)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment