fellow_disk_obj: macro for fdsl access

parent 13c7ad3b
......@@ -595,6 +595,10 @@ struct fellow_disk_obj {
uint8_t va_data[];
};
// pointer to the embedded fdsl
#define fellow_disk_obj_fdsl(fdo) \
(void *)((uint8_t *)fdo + sizeof *fdo + fdo->va_data_len)
// shaved off one pointer...
#define FCO_FCS(fco) (&(fco)->fdo_fcs)
#define FCO_FDO(fco) fellow_disk_obj(FCO_FCS(fco))
......@@ -2221,8 +2225,7 @@ fellow_busy_obj_alloc(struct fellow_cache *fc,
fcs->refcnt = 2;
fellow_cache_seg_transition_locked_notincore(fcs, FCO_BUSY);
fdsl = fellow_disk_seglist_init(
(void *)((uint8_t *)fdo + sizeof *fdo + wsl),
fdsl = fellow_disk_seglist_init(fellow_disk_obj_fdsl(fdo),
ldsegs, fc->tune->hash_obj);
fellow_cache_seglist_associate(&fco->seglist, fdsl, FCS_USABLE);
// DBG("fdsl lsegs %u fcsl lsegs %u", fdsl->lsegs, fco->seglist.lsegs);
......@@ -5304,7 +5307,7 @@ struct objcore **ocp, uintptr_t priv2, unsigned crit)
if (fco->oc)
fco->oc->oa_present |= fdoa2oa_present(fdo->fdoa_present);
fdsl = (void *)((uint8_t *)fdo + sizeof *fdo + fdo->va_data_len);
fdsl = fellow_disk_obj_fdsl(fdo);
assert(PAOK(fdsl));
// XXX load of folow-up seglists could be async
// should not be a common case though, we try to make the first
......
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