diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2019-03-07 19:27:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-07 21:31:59 -0500 |
commit | f1fffbd44722cec9b8dd54d5cc86bd081ce39217 (patch) | |
tree | 290d72548bba7ed3dd5555460b1dfa8380e49497 /include/linux/fs.h | |
parent | ef27ac18b361b77904e8a782d9030a7e4333531a (diff) |
linux/fs.h: move member alignment check next to definition of struct filename
Instead of doing this compile-time check in some slightly arbitrary user
of struct filename, put it next to the definition.
Link: http://lkml.kernel.org/r/20190208203015.29702-3-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 08f26046233e..1a775aa3e349 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -37,6 +37,8 @@ | |||
37 | #include <linux/uuid.h> | 37 | #include <linux/uuid.h> |
38 | #include <linux/errseq.h> | 38 | #include <linux/errseq.h> |
39 | #include <linux/ioprio.h> | 39 | #include <linux/ioprio.h> |
40 | #include <linux/build_bug.h> | ||
41 | #include <linux/stddef.h> | ||
40 | 42 | ||
41 | #include <asm/byteorder.h> | 43 | #include <asm/byteorder.h> |
42 | #include <uapi/linux/fs.h> | 44 | #include <uapi/linux/fs.h> |
@@ -2493,6 +2495,7 @@ struct filename { | |||
2493 | struct audit_names *aname; | 2495 | struct audit_names *aname; |
2494 | const char iname[]; | 2496 | const char iname[]; |
2495 | }; | 2497 | }; |
2498 | static_assert(offsetof(struct filename, iname) % sizeof(long) == 0); | ||
2496 | 2499 | ||
2497 | extern long vfs_truncate(const struct path *, loff_t); | 2500 | extern long vfs_truncate(const struct path *, loff_t); |
2498 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | 2501 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, |