Refactor fellow_busy_body_seg_next(): Introduce fdsl variable

parent 6bdb638a
......@@ -3977,27 +3977,30 @@ static struct fellow_cache_res
fellow_busy_body_seg_next(struct fellow_busy *fbo)
{
struct fellow_cache_seglist *fcsl;
struct fellow_disk_seglist *fdsl;
struct fellow_cache_seg *fcs;
struct fellow_cache_res fcr;
CHECK_OBJ_NOTNULL(fbo, FELLOW_BUSY_MAGIC);
fcsl = fbo->body_seglist;
CHECK_OBJ_NOTNULL(fcsl, FELLOW_CACHE_SEGLIST_MAGIC);
CHECK_OBJ_NOTNULL(fcsl->fdsl, FELLOW_DISK_SEGLIST_MAGIC);
assert(fcsl->fdsl->nsegs <= fcsl->lsegs);
if (fcsl->fdsl->nsegs == fcsl->lsegs ||
fcsl->segs[fcsl->fdsl->nsegs].state == FCS_INIT) {
fdsl = fcsl->fdsl;
CHECK_OBJ_NOTNULL(fdsl, FELLOW_DISK_SEGLIST_MAGIC);
assert(fdsl->nsegs <= fcsl->lsegs);
if (fdsl->nsegs == fcsl->lsegs ||
fcsl->segs[fdsl->nsegs].state == FCS_INIT) {
fcr = fellow_busy_body_seglist_alloc(fbo, fcsl);
if (fcr.status != fcr_ok)
return (fcr);
CAST_OBJ_NOTNULL(fcsl, fcr.r.ptr, FELLOW_CACHE_SEGLIST_MAGIC);
fbo->body_seglist = fcsl;
fdsl = fcsl->fdsl;
}
AN(fcsl->fdsl);
assert(fcsl->fdsl->nsegs < fcsl->lsegs);
CHECK_OBJ_NOTNULL(fdsl, FELLOW_DISK_SEGLIST_MAGIC);
assert(fdsl->nsegs < fcsl->lsegs);
fcs = &fcsl->segs[fcsl->fdsl->nsegs];
fcs = &fcsl->segs[fdsl->nsegs];
fbo->body_seg = fcs;
assert(fcs->state == FCS_USABLE);
assert(fcs->fco == fbo->fco);
......
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