diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-10-08 17:05:01 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-11-09 06:16:27 +0100 |
commit | 22a8cb8248ba5d340307ba72432253b1dbdb5cf7 (patch) | |
tree | ddb88cce781598c909769c4d92f1e38d2716cd52 /fs/coredump.c | |
parent | spufs: get rid of dump_emit() wrappers (diff) | |
download | linux-22a8cb8248ba5d340307ba72432253b1dbdb5cf7.tar.xz linux-22a8cb8248ba5d340307ba72432253b1dbdb5cf7.zip |
new helper: dump_align()
dump_skip to given alignment...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/coredump.c')
-rw-r--r-- | fs/coredump.c | 9 |
1 files changed, 9 insertions, 0 deletions
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); |