1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

r7792: make the allocation size rounding in pvfs configurable

This commit is contained in:
Andrew Tridgell 2005-06-21 04:23:05 +00:00 committed by Gerald (Jerry) Carter
parent f385753a52
commit 1f35642bed
3 changed files with 8 additions and 3 deletions

View File

@ -198,7 +198,6 @@ uint32_t pvfs_name_hash(const char *key, size_t length)
*/
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);
}

View File

@ -51,6 +51,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs)
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

View File

@ -72,6 +72,9 @@ struct pvfs_state {
/* 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;