From 22a8cb8248ba5d340307ba72432253b1dbdb5cf7 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 8 Oct 2013 11:05:01 -0400 Subject: new helper: dump_align() dump_skip to given alignment... Signed-off-by: Al Viro --- fs/coredump.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fs/coredump.c') diff --git a/fs/coredump.c b/fs/coredump.c index 18baf2c009d4..dc1f937413d5 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -728,3 +728,12 @@ int dump_skip(struct coredump_params *cprm, size_t nr) } } 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); -- cgit v1.2.3-58-ga151