commit | 22a8cb8248ba5d340307ba72432253b1dbdb5cf7 | [log] [tgz] |
---|---|---|
author | Al Viro <[email protected]> | Tue Oct 08 11:05:01 2013 -0400 |
committer | Al Viro <[email protected]> | Sat Nov 09 00:16:27 2013 -0500 |
tree | ddb88cce781598c909769c4d92f1e38d2716cd52 | |
parent | 7b1f4020d0d16a17b9c48570bdb7b4ad99be3553 [diff] [blame] |
new helper: dump_align() dump_skip to given alignment... Signed-off-by: Al Viro <[email protected]>
diff --git a/fs/coredump.c b/fs/coredump.c index 18baf2c..dc1f937 100644 --- a/fs/coredump.c +++ b/fs/coredump.c
@@ -728,3 +728,12 @@ } } EXPORT_SYMBOL(dump_skip); + +int dump_align(struct coredump_params *cprm, int align) +{ + unsigned mod = cprm->written & (align - 1); + if (align & (align - 1)) + return -EINVAL; + return mod ? dump_skip(cprm, align - mod) : 0; +} +EXPORT_SYMBOL(dump_align);