noop refactor: fcs eviction with/without lru

parent d52435a7
......@@ -2504,18 +2504,27 @@ fellow_cache_async_thread(void *priv)
// XXX better way
#ifndef TEST_DRIVER
static inline void
fellow_cache_seg_evict_locked(struct fellow_cache *fc,
fellow_cache_seg_evict_locked(
struct fellow_cache_seg *fcs, struct buddy_ptr_extent *alloc)
{
AZ(fcs->refcnt);
AN(fcs->fcs_onlru);
AZ(fcs->fcs_onlru);
assert(fcs->state == FCS_INCORE);
*alloc = fcs->alloc;
fcs->alloc = buddy_ptr_extent_nil;
fcs->len = 0;
fcs->state = FCS_DISK;
}
static inline void
fellow_cache_lru_seg_evict_locked(
struct fellow_cache_seg *fcs, struct buddy_ptr_extent *alloc,
struct fellow_cache *fc)
{
AN(fcs->fcs_onlru);
fcs->fcs_onlru = 0;
VTAILQ_REMOVE(&fc->lru_head, fcs, lru_list);
fellow_cache_seg_evict_locked(fcs, alloc);
}
static int
......@@ -2546,8 +2555,8 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache *fc)
continue;
}
if (fcs->state == FCS_INCORE) {
fellow_cache_seg_evict_locked(fc, fcs,
&alloc);
fellow_cache_lru_seg_evict_locked(fcs,
&alloc, fc);
AZ(pthread_mutex_unlock(&fco->mtx));
fco = NULL;
break;
......@@ -2648,7 +2657,7 @@ fellow_cache_lru_thread(struct worker *wrk, void *priv)
buddy = fc->membuddy;
CHECK_OBJ(buddy, BUDDY_MAGIC);
// fellow_cache_seg_evict_locked()
// fellow_cache_lru_seg_evict_locked()
assert_fcos_transition(FCS_INCORE, FCS_DISK);
reqs = BUDDY_REQS_STK(buddy, BUDDY_REQS_MAX);
......
......@@ -381,6 +381,13 @@ sfemem_objslim(struct worker *wrk, struct objcore *memoc)
mutate_to_sfeexp(memoc, xid);
return;
}
/*
* for calls from HSH_Cancel, we could write a new disk object with no
* body. For now, just free any body segments cached in memory
*/
}
static void v_matchproto_(objfree_f)
......
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