Skip to content

RFC fsnotify, dnotify, and inotify

Eric Paris lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest14 patches 33 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14filesystem notification: create fs/notify to contain all fs notificationfs/Kconfig fs/Makefile fs/notify/Kconfig +8 more+46 -420 replies
2/14fsnotify: pass a file instead of an inode to open, read, and writefs/compat.c fs/nfsd/vfs.c fs/open.c +2 more+15 -130 replies
3/14fsnotify: sys_execve and sys_uselib do not call into fsnotifyfs/exec.c include/linux/fsnotify.h+12 -00 replies
4/14fsnotify: use the new open-exec hook for inotify and dnotifyinclude/linux/fsnotify.h+6 -01 reply
5/14fsnotify: unified filesystem notification backendfs/notify/Kconfig fs/notify/Makefile fs/notify/fsnotify.c +5 more+578 -82 replies
6/14fsnotify: add group prioritiesfs/notify/group.c include/linux/fsnotify_backend.h+27 -70 replies
7/14fsnotify: add in inode fsnotify markingsfs/inode.c fs/notify/Makefile fs/notify/fsnotify.c +6 more+378 -14 replies
8/14fsnotify: parent event notificationfs/notify/inode_mark.c include/linux/dcache.h include/linux/fsnotify.h +1 more+109 -40 replies
9/14dnotify: reimplement dnotify using fsnotifyfs/fcntl.c fs/notify/dnotify/Kconfig fs/notify/dnotify/dnotify.c +3 more+271 -1610 replies
10/14fsnotify: generic notification queue and waitqfs/notify/fsnotify.h fs/notify/group.c fs/notify/notification.c +1 more+172 -00 replies
11/14fsnotify: include pathnames with entries when possiblefs/notify/fsnotify.c fs/notify/fsnotify.h fs/notify/notification.c +2 more+45 -252 replies
12/14fsnotify: add correlations between eventsfs/notify/fsnotify.c fs/notify/fsnotify.h fs/notify/notification.c +2 more+44 -264 replies
13/14inotify: reimplement inotify using fsnotifyfs/inode.c fs/notify/inotify/Kconfig fs/notify/inotify/Makefile +6 more+783 -4643 replies
14/14shit on top for debuggingfs/notify/dnotify/dnotify.c fs/notify/fsnotify.c fs/notify/group.c +6 more+54 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH -v4 00/14] fsnotify, dnotify, and inotify

The following series implements a new generic in kernel filesystem notification system, fsnotify. On top of fsnotify I reimplement dnotify and inotify. I have not finished with the change from inotify although I think inotify_user should be completed. In kernel inotify users (aka audit) still (until I get positive feedback) relay on the old inotify backend. This can be 'easily' fixed.

All of this is in preperation for fanotify and using fanotify as an on access
file scanner. So you better know it's coming.

Why is this useful? Because I actually shrank the struct inode. That's right, my code is smaller and faster. Eat that.

struct inode went from:

        unsigned long           i_dnotify_mask; /* Directory notify events */
        struct dnotify_struct   *i_dnotify; /* for directory notifications */
        struct list_head        inotify_watches; /* watches on this inode */
        struct mutex            inotify_mutex;  /* protects the watches list */

to:
__u64 i_fsnotify_mask; /* all events this inode cares about */
struct list_head i_fsnotify_mark_entries; /* fsnotify mark entries */

This is just an RFC as I haven't tested it heavily I might still be able to split patches. I think there are some problem at the moment trying to build fsnotify out. I need to send patch 3 and 4 seperately. Actually I think it's perfectly reasonable to take patches 1-4 as is right now.

if you ever want to see more up2date patches check out:
http://people.redhat.com/~eparis/fsnotify

---

Eric Paris (14):
shit on top for debugging
inotify: reimplement inotify using fsnotify
fsnotify: add correlations between events
fsnotify: include pathnames with entries when possible
fsnotify: generic notification queue and waitq
dnotify: reimplement dnotify using fsnotify
fsnotify: parent event notification
fsnotify: add in inode fsnotify markings
fsnotify: add group priorities
fsnotify: unified filesystem notification backend
fsnotify: use the new open-exec hook for inotify and dnotify
fsnotify: sys_execve and sys_uselib do not call into fsnotify
fsnotify: pass a file instead of an inode to open, read, and write filesystem notification: create fs/notify to contain all fs notification

 fs/Kconfig                           |   39 -
 fs/Makefile                          |    5 
 fs/compat.c                          |    5 
 fs/dnotify.c                         |  194 -------
 fs/exec.c                            |    5 
 fs/fcntl.c                           |    4 
 fs/inode.c                           |    7 
 fs/inotify.c                         |  913 ----------------------------------
 fs/inotify_user.c                    |  778 -----------------------------
 fs/nfsd/vfs.c                        |    4 
 fs/notify/Kconfig                    |   14 +
 fs/notify/Makefile                   |    4 
 fs/notify/dnotify/Kconfig            |   11 
 fs/notify/dnotify/Makefile           |    1 
 fs/notify/dnotify/dnotify.c          |  350 +++++++++++++
 fs/notify/fsnotify.c                 |   92 +++
 fs/notify/fsnotify.h                 |  115 ++++
 fs/notify/group.c                    |  222 ++++++++
 fs/notify/inode_mark.c               |  279 ++++++++++
 fs/notify/inotify/Kconfig            |   31 +
 fs/notify/inotify/Makefile           |    2 
 fs/notify/inotify/inotify.c          |  913 ++++++++++++++++++++++++++++++++++
 fs/notify/inotify/inotify.h          |  117 ++++
 fs/notify/inotify/inotify_fsnotify.c |  190 +++++++
 fs/notify/inotify/inotify_kernel.c   |  299 +++++++++++
 fs/notify/inotify/inotify_user.c     |  502 +++++++++++++++++++
 fs/notify/notification.c             |  279 ++++++++++
 fs/open.c                            |    2 
 fs/read_write.c                      |    8 
 include/linux/dcache.h               |    3 
 include/linux/dnotify.h              |   29 -
 include/linux/fs.h                   |    6 
 include/linux/fsnotify.h             |  271 ++++++++--
 include/linux/fsnotify_backend.h     |  152 ++++++
 include/linux/inotify.h              |    1 
 35 files changed, 3818 insertions(+), 2029 deletions(-)
 delete mode 100644 fs/dnotify.c
 delete mode 100644 fs/inotify.c
 delete mode 100644 fs/inotify_user.c
 create mode 100644 fs/notify/Kconfig
 create mode 100644 fs/notify/Makefile
 create mode 100644 fs/notify/dnotify/Kconfig
 create mode 100644 fs/notify/dnotify/Makefile
 create mode 100644 fs/notify/dnotify/dnotify.c
 create mode 100644 fs/notify/fsnotify.c
 create mode 100644 fs/notify/fsnotify.h
 create mode 100644 fs/notify/group.c
 create mode 100644 fs/notify/inode_mark.c
 create mode 100644 fs/notify/inotify/Kconfig
 create mode 100644 fs/notify/inotify/Makefile
 create mode 100644 fs/notify/inotify/inotify.c
 create mode 100644 fs/notify/inotify/inotify.h
 create mode 100644 fs/notify/inotify/inotify_fsnotify.c
 create mode 100644 fs/notify/inotify/inotify_kernel.c
 create mode 100644 fs/notify/inotify/inotify_user.c
 create mode 100644 fs/notify/notification.c
 create mode 100644 include/linux/fsnotify_backend.h