]> git.baikalelectronics.ru Git - kernel.git/commit
fanotify: reduce event objectid to 29-bit hash
authorAmir Goldstein <amir73il@gmail.com>
Thu, 4 Mar 2021 10:48:23 +0000 (12:48 +0200)
committerJan Kara <jack@suse.cz>
Tue, 16 Mar 2021 15:14:28 +0000 (16:14 +0100)
commit52aaaca9f5497ed7ed1b189c9f397eb44e634ee5
tree00f938ddb78faf853b1ffe3c8ca21e58f670e781
parent565864af13ea5aa6caf942d8cd8ec64899b0f060
fanotify: reduce event objectid to 29-bit hash

objectid is only used by fanotify backend and it is just an optimization
for event merge before comparing all fields in event.

Move the objectid member from common struct fsnotify_event into struct
fanotify_event and reduce it to 29-bit hash to cram it together with the
3-bit event type.

Events of different types are never merged, so the combination of event
type and hash form a 32-bit key for fast compare of events.

This reduces the size of events by one pointer and paves the way for
adding hashed queue support for fanotify.

Link: https://lore.kernel.org/r/20210304104826.3993892-3-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify.c
fs/notify/fanotify/fanotify.h
fs/notify/inotify/inotify_fsnotify.c
fs/notify/inotify/inotify_user.c
include/linux/fsnotify_backend.h