svn commit: samba r7792 - in branches/SAMBA_4_0/source/ntvfs/posix:
.
tridge at samba.org
tridge at samba.org
Tue Jun 21 04:23:06 GMT 2005
Author: tridge
Date: 2005-06-21 04:23:05 +0000 (Tue, 21 Jun 2005)
New Revision: 7792
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7792
Log:
make the allocation size rounding in pvfs configurable
Modified:
branches/SAMBA_4_0/source/ntvfs/posix/pvfs_util.c
branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.h
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_util.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_util.c 2005-06-21 03:51:54 UTC (rev 7791)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_util.c 2005-06-21 04:23:05 UTC (rev 7792)
@@ -198,7 +198,6 @@
*/
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);
}
Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2005-06-21 03:51:54 UTC (rev 7791)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2005-06-21 04:23:05 UTC (rev 7792)
@@ -51,6 +51,9 @@
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
Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.h
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.h 2005-06-21 03:51:54 UTC (rev 7791)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.h 2005-06-21 04:23:05 UTC (rev 7792)
@@ -72,6 +72,9 @@
/* 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;
More information about the samba-cvs
mailing list