summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-17 07:17:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:55 -0500
commitf4e5f3a498bce04312898dfe92104fafc1fc2aa2 (patch)
tree0ce2a234541dc79a81379da683f6a00529ac234b /source4/ntvfs/posix/pvfs_util.c
parent856f663adc2459044f7a20c2974bcb41ed561f77 (diff)
downloadsamba-f4e5f3a498bce04312898dfe92104fafc1fc2aa2.tar.gz
samba-f4e5f3a498bce04312898dfe92104fafc1fc2aa2.tar.bz2
samba-f4e5f3a498bce04312898dfe92104fafc1fc2aa2.zip
r3801: added allocation size rounding. This is needed for ifstest.
(This used to be commit 8a6fa43156667f75e058c7d44b1c15a6cf7067b2)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_util.c')
-rw-r--r--source4/ntvfs/posix/pvfs_util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c
index 9f617d39d4..67dd9d22b3 100644
--- a/source4/ntvfs/posix/pvfs_util.c
+++ b/source4/ntvfs/posix/pvfs_util.c
@@ -187,3 +187,14 @@ uint32_t pvfs_name_hash(const char *key, size_t length)
return value;
}
+
+
+/*
+ file allocation size rounding. This is required to pass ifstest
+*/
+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;
+}