+ /*
+ * We cap this to allow a block to be at least allowed to
+ * be allocated using the buddy allocator. That's MAX_ORDER
+ * pages. So 4 MiB on x86_64.
+ */
+ if (ctx->blocksize > (1 << (MAX_ORDER + PAGE_SHIFT)))
+ goto bad_value; > +
+ /* The blocksize must be a multiple of the page size so must be aligned */
+ if (!PAGE_ALIGNED(ctx->blocksize))
+ goto bad_value;
+ break;
}
return 0;