Factor out the commit part of fellow_busy_region_alloc()

parent 918c9f20
......@@ -2182,21 +2182,15 @@ fellow_region_alloc(const struct fellow_cache *fc, size_t size, int8_t cram)
FEP_SPC, size, cram));
}
/* allocate a new region for body, aux attr or seglist
*
* aux attr use: We do not yet coalesce allocations because
* there only is a single aux attr, so the one segment gets
* its own region
*/
/* commit a region to the busy object */
static struct buddy_off_extent *
fellow_busy_region_alloc(struct fellow_busy *fbo, size_t size, int8_t cram)
fellow_busy_region_commit(struct fellow_busy *fbo, struct buddy_off_extent reg)
{
struct buddy_off_extent *fdr, reg;
struct buddy_off_extent *fdr;
CHECK_OBJ_NOTNULL(fbo, FELLOW_BUSY_MAGIC);
reg = fellow_region_alloc(fbo->fc, size, cram);
if (reg.off < 0) {
return (NULL);
}
......@@ -2211,6 +2205,22 @@ fellow_busy_region_alloc(struct fellow_busy *fbo, size_t size, int8_t cram)
return (fdr);
}
/* allocate a new region for body, aux attr or seglist
*
* aux attr use: We do not yet coalesce allocations because
* there only is a single aux attr, so the one segment gets
* its own region
*/
static struct buddy_off_extent *
fellow_busy_region_alloc(struct fellow_busy *fbo, size_t size, int8_t cram)
{
CHECK_OBJ_NOTNULL(fbo, FELLOW_BUSY_MAGIC);
return (fellow_busy_region_commit(fbo,
fellow_region_alloc(fbo->fc, size, cram)));
}
/*
* return an unused region for seglist trim
*/
......
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