summaryrefslogtreecommitdiff
path: root/ext4_utils/ext4_utils.h
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-08-05 11:56:38 -0700
committerColin Cross <ccross@android.com>2010-08-05 14:38:47 -0700
commit6bd2b5d80db5630cb73e3e5a4be3b38afa241c5a (patch)
treeeb95b397af1cbfc69091324f65173f88862b81af /ext4_utils/ext4_utils.h
parent7eb4165b83ca3724b64c8925fa530362b6072bc2 (diff)
downloadextras-6bd2b5d80db5630cb73e3e5a4be3b38afa241c5a.tar.gz
Fix calculation of dentry size
The PAD_TO function was incorrectly handling values that were already aligned, which could lead to overruns of the dentry block. Fix the function, rename it to ALIGN, move it to ext4_utils.h, and use it everywhere the dentry size is calculated. Change-Id: Ie9778d2c6f72d3db9a3162e52882377a71b8420a
Diffstat (limited to 'ext4_utils/ext4_utils.h')
-rw-r--r--ext4_utils/ext4_utils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/ext4_utils.h
index 294c8c5e..0a2b542a 100644
--- a/ext4_utils/ext4_utils.h
+++ b/ext4_utils/ext4_utils.h
@@ -38,6 +38,7 @@ extern int force;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define DIV_ROUND_UP(x, y) (((x) + (y) - 1)/(y))
+#define ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y)))
#define __le64 u64
#define __le32 u32