*/
uint64_t pvfs_round_alloc_size(struct pvfs_state *pvfs, uint64_t size)
{
- const uint64_t round_value = 511;
- if (size == 0) return 0;
- return (size + round_value) & ~round_value;
+ const uint32_t round_value = pvfs->alloc_size_rounding;
+ return round_value * ((size + round_value - 1)/round_value);
}
pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS;
}
+ /* this must be a power of 2 */
+ pvfs->alloc_size_rounding = lp_parm_int(-1, "posix", "allocationrounding", 512);
+
#if HAVE_XATTR_SUPPORT
if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE;
#endif
/* if posix:eadb is set, then this gets setup */
struct tdb_wrap *ea_db;
+ /* the allocation size rounding */
+ uint32_t alloc_size_rounding;
+
/* used to accelerate acl mapping */
struct {
const struct dom_sid *creator_owner;