Skip to content

Commit 3bb66d7

Browse files
committed
Merge branch 'for-linus' of git://git.infradead.org/users/eparis/notify
* 'for-linus' of git://git.infradead.org/users/eparis/notify: fsnotify: allow groups to set freeing_mark to null inotify/dnotify: should_send_event shouldn't match on FS_EVENT_ON_CHILD dnotify: do not bother to lock entry->lock when reading mask dnotify: do not use ?true:false when assigning to a bool fsnotify: move events should indicate the event was on a child inotify: reimplement inotify using fsnotify fsnotify: handle filesystem unmounts with fsnotify marks fsnotify: fsnotify marks on inodes pin them in core fsnotify: allow groups to add private data to events 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 marks to inodes so groups can interpret how to handle those inodes fsnotify: unified filesystem notification backend
2 parents 512626a + a092ee2 commit 3bb66d7

23 files changed

+2813
-662
lines changed

MAINTAINERS

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,10 +1802,10 @@ F: drivers/char/epca*
18021802
F: drivers/char/digi*
18031803

18041804
DIRECTORY NOTIFICATION (DNOTIFY)
1805-
P: Stephen Rothwell
1806-
M: sfr@canb.auug.org.au
1805+
P: Eric Paris
1806+
M: eparis@parisplace.org
18071807
L: linux-kernel@vger.kernel.org
1808-
S: Supported
1808+
S: Maintained
18091809
F: Documentation/filesystems/dnotify.txt
18101810
F: fs/notify/dnotify/
18111811
F: include/linux/dnotify.h
@@ -2858,6 +2858,8 @@ P: John McCutchan
28582858
M: john@johnmccutchan.com
28592859
P: Robert Love
28602860
M: rlove@rlove.org
2861+
P: Eric Paris
2862+
M: eparis@parisplace.org
28612863
L: linux-kernel@vger.kernel.org
28622864
S: Maintained
28632865
F: Documentation/filesystems/inotify.txt

fs/inode.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/cdev.h>
2323
#include <linux/bootmem.h>
2424
#include <linux/inotify.h>
25+
#include <linux/fsnotify.h>
2526
#include <linux/mount.h>
2627
#include <linux/async.h>
2728

@@ -189,6 +190,10 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode)
189190
inode->i_private = NULL;
190191
inode->i_mapping = mapping;
191192

193+
#ifdef CONFIG_FSNOTIFY
194+
inode->i_fsnotify_mask = 0;
195+
#endif
196+
192197
return inode;
193198

194199
out_free_security:
@@ -221,6 +226,7 @@ void destroy_inode(struct inode *inode)
221226
BUG_ON(inode_has_buffers(inode));
222227
ima_inode_free(inode);
223228
security_inode_free(inode);
229+
fsnotify_inode_delete(inode);
224230
if (inode->i_sb->s_op->destroy_inode)
225231
inode->i_sb->s_op->destroy_inode(inode);
226232
else
@@ -252,6 +258,9 @@ void inode_init_once(struct inode *inode)
252258
INIT_LIST_HEAD(&inode->inotify_watches);
253259
mutex_init(&inode->inotify_mutex);
254260
#endif
261+
#ifdef CONFIG_FSNOTIFY
262+
INIT_HLIST_HEAD(&inode->i_fsnotify_mark_entries);
263+
#endif
255264
}
256265
EXPORT_SYMBOL(inode_init_once);
257266

@@ -398,6 +407,7 @@ int invalidate_inodes(struct super_block *sb)
398407
mutex_lock(&iprune_mutex);
399408
spin_lock(&inode_lock);
400409
inotify_unmount_inodes(&sb->s_inodes);
410+
fsnotify_unmount_inodes(&sb->s_inodes);
401411
busy = invalidate_list(&sb->s_inodes, &throw_away);
402412
spin_unlock(&inode_lock);
403413

fs/notify/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
config FSNOTIFY
2+
bool "Filesystem notification backend"
3+
default y
4+
---help---
5+
fsnotify is a backend for filesystem notification. fsnotify does
6+
not provide any userspace interface but does provide the basis
7+
needed for other notification schemes such as dnotify, inotify,
8+
and fanotify.
9+
10+
Say Y here to enable fsnotify suport.
11+
12+
If unsure, say Y.
13+
114
source "fs/notify/dnotify/Kconfig"
215
source "fs/notify/inotify/Kconfig"

fs/notify/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
obj-$(CONFIG_FSNOTIFY) += fsnotify.o notification.o group.o inode_mark.o
2+
13
obj-y += dnotify/
24
obj-y += inotify/

fs/notify/dnotify/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config DNOTIFY
22
bool "Dnotify support"
3+
depends on FSNOTIFY
34
default y
45
help
56
Dnotify is a directory-based per-fd file change notification system

0 commit comments

Comments
 (0)