diff options
author | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:37 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:49 -0400 |
commit | f874e1ac21d7708464dc656a10312542c54719f1 (patch) | |
tree | be47a1f5333208647e016f1861eaf21fb963478b /fs/notify | |
parent | 8c1934c8d70b22ca8333b216aec6c7d09fdbd6a6 (diff) |
inotify: force inotify and fsnotify use same bits
inotify uses bits called IN_* and fsnotify uses bits called FS_*. These
need to line up. This patch adds build time checks to make sure noone can
change these bits so they are not the same.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify')
-rw-r--r-- | fs/notify/inotify/inotify_user.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index dfc80f70e517..c8203ce28ab7 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -839,6 +839,27 @@ out: | |||
839 | */ | 839 | */ |
840 | static int __init inotify_user_setup(void) | 840 | static int __init inotify_user_setup(void) |
841 | { | 841 | { |
842 | BUILD_BUG_ON(IN_ACCESS != FS_ACCESS); | ||
843 | BUILD_BUG_ON(IN_MODIFY != FS_MODIFY); | ||
844 | BUILD_BUG_ON(IN_ATTRIB != FS_ATTRIB); | ||
845 | BUILD_BUG_ON(IN_CLOSE_WRITE != FS_CLOSE_WRITE); | ||
846 | BUILD_BUG_ON(IN_CLOSE_NOWRITE != FS_CLOSE_NOWRITE); | ||
847 | BUILD_BUG_ON(IN_OPEN != FS_OPEN); | ||
848 | BUILD_BUG_ON(IN_MOVED_FROM != FS_MOVED_FROM); | ||
849 | BUILD_BUG_ON(IN_MOVED_TO != FS_MOVED_TO); | ||
850 | BUILD_BUG_ON(IN_CREATE != FS_CREATE); | ||
851 | BUILD_BUG_ON(IN_DELETE != FS_DELETE); | ||
852 | BUILD_BUG_ON(IN_DELETE_SELF != FS_DELETE_SELF); | ||
853 | BUILD_BUG_ON(IN_MOVE_SELF != FS_MOVE_SELF); | ||
854 | BUILD_BUG_ON(IN_UNMOUNT != FS_UNMOUNT); | ||
855 | BUILD_BUG_ON(IN_Q_OVERFLOW != FS_Q_OVERFLOW); | ||
856 | BUILD_BUG_ON(IN_IGNORED != FS_IN_IGNORED); | ||
857 | BUILD_BUG_ON(IN_EXCL_UNLINK != FS_EXCL_UNLINK); | ||
858 | BUILD_BUG_ON(IN_ISDIR != FS_IN_ISDIR); | ||
859 | BUILD_BUG_ON(IN_ONESHOT != FS_IN_ONESHOT); | ||
860 | |||
861 | BUG_ON(hweight32(ALL_INOTIFY_BITS) != 21); | ||
862 | |||
842 | inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark, SLAB_PANIC); | 863 | inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark, SLAB_PANIC); |
843 | event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC); | 864 | event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC); |
844 | 865 | ||