fellow_logcache: remove useless size argument

the logcache should know the best size
parent b4d13d1f
......@@ -1162,12 +1162,12 @@ fellow_logcache_fini(struct fellow_logcache *flc)
static void
fellow_logcache_init(struct fellow_logcache *flc, struct fellow_fd *ffd,
uint8_t id, const struct buddy_off_extent *region, unsigned n)
uint8_t id, const struct buddy_off_extent *region)
{
struct fellow_logcache_entry *fle;
struct buddy_reqs *reqs;
size_t sz;
unsigned u;
unsigned n, u;
AN(ffd);
AN(flc);
......@@ -1175,11 +1175,10 @@ fellow_logcache_init(struct fellow_logcache *flc, struct fellow_fd *ffd,
// sane upper limit to not eat up all of the membuddy
sz = buddy_size(ffd->membuddy) / 8;
sz >>= MIN_FELLOW_BITS;
if (n > sz)
n = (typeof(n))sz;
n = (typeof(n))sz;
if (n > BUDDY_REQS_MAX)
n = BUDDY_REQS_MAX;
if (n < 2)
else if (n < 2)
n = 2; // fellow_logcache_(take|steal) assume 2 entries min
INIT_OBJ(flc, FELLOW_LOGCACHE_MAGIC);
......@@ -3515,7 +3514,7 @@ logbuffer_append(struct fellow_fd *ffd,
*/
dsk_init:
AN(from->id);
fellow_logcache_init(flc, ffd, from->id, from->logreg->region, 255);
fellow_logcache_init(flc, ffd, from->id, from->logreg->region);
AZ(locked);
dsk:
where = NULL;
......@@ -5127,7 +5126,7 @@ fellow_logs_iter(const struct flics *flics, struct flivs *flivs,
CHECK_OBJ_NOTNULL(flics, FLICS_MAGIC);
CHECK_OBJ_NOTNULL(flivs, FLIVS_MAGIC);
fellow_logcache_init(flc, flics->ffd, 0, active_logregion, 255);
fellow_logcache_init(flc, flics->ffd, 0, active_logregion);
assert(flics->ffd->phase > FP_INVAL);
assert(flics->ffd->phase < FP_LIM);
......
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