summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-21 04:23:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:36 -0500
commit51b1451cbaf7b27af1d5f1a5f5a42430afe99234 (patch)
tree1ad4cb2a2d2fa11b27634fecaa6667640e7004f8 /source4
parent331aaa52562f0676224f1b00f7e306210797c790 (diff)
downloadsamba-51b1451cbaf7b27af1d5f1a5f5a42430afe99234.tar.gz
samba-51b1451cbaf7b27af1d5f1a5f5a42430afe99234.tar.bz2
samba-51b1451cbaf7b27af1d5f1a5f5a42430afe99234.zip
r7792: make the allocation size rounding in pvfs configurable
(This used to be commit 1f35642bed1129d0834906b3e94e8868992d6eb9)
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/posix/pvfs_util.c5
-rw-r--r--source4/ntvfs/posix/vfs_posix.c3
-rw-r--r--source4/ntvfs/posix/vfs_posix.h3
3 files changed, 8 insertions, 3 deletions
diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c
index d716834fed..f286dfdc48 100644
--- a/source4/ntvfs/posix/pvfs_util.c
+++ b/source4/ntvfs/posix/pvfs_util.c
@@ -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);
}
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c
index 846ba61a86..906428fc6d 100644
--- a/source4/ntvfs/posix/vfs_posix.c
+++ b/source4/ntvfs/posix/vfs_posix.c
@@ -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
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index a55674d69a..b5b0e2b28d 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -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;