Skip to content

Commit

Permalink
remove limitation that min/max chunk size must be a multiple of page …
Browse files Browse the repository at this point in the history
…size

Also mentioned by Issue #20.
  • Loading branch information
upa committed Apr 26, 2024
1 parent 61199ac commit 01fe30e
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/mscp.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,8 @@ static int validate_and_set_defaut_params(struct mscp_opts *o)

if (o->min_chunk_sz == 0)
o->min_chunk_sz = DEFAULT_MIN_CHUNK_SZ;
else {
if (o->min_chunk_sz < getpagesize() ||
o->min_chunk_sz % getpagesize() != 0) {
priv_set_errv("min chunk size must be "
"larget than and multiple of page size %d: %lu",
getpagesize(), o->min_chunk_sz);
return -1;
}
}

if (o->max_chunk_sz) {
if (o->max_chunk_sz < getpagesize() ||
o->max_chunk_sz % getpagesize() != 0) {
priv_set_errv("min chunk size must be larget than and "
"multiple of page size %d: %lu",
getpagesize(), o->max_chunk_sz);
}
if (o->min_chunk_sz > o->max_chunk_sz) {
priv_set_errv("smaller max chunk size than "
"min chunk size: %lu < %lu",
Expand Down

0 comments on commit 01fe30e

Please sign in to comment.