Commit c908370f authored by Eric Paris's avatar Eric Paris

fsnotify: allow ignored_mask to survive modification

Some inodes a group may want to never hear about a set of events even if
the inode is modified.  We add a new mark flag which indicates that these
marks should not have their ignored_mask cleared on modification.
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent e8983861
...@@ -148,6 +148,7 @@ void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is) ...@@ -148,6 +148,7 @@ void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is)
if (!hlist_empty(&inode->i_fsnotify_marks)) { if (!hlist_empty(&inode->i_fsnotify_marks)) {
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
hlist_for_each_entry(mark, node, &inode->i_fsnotify_marks, i.i_list) { hlist_for_each_entry(mark, node, &inode->i_fsnotify_marks, i.i_list) {
if (!(mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY))
mark->ignored_mask = 0; mark->ignored_mask = 0;
} }
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
...@@ -160,6 +161,7 @@ void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is) ...@@ -160,6 +161,7 @@ void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is)
if (mnt && !hlist_empty(&mnt->mnt_fsnotify_marks)) { if (mnt && !hlist_empty(&mnt->mnt_fsnotify_marks)) {
spin_lock(&mnt->mnt_root->d_lock); spin_lock(&mnt->mnt_root->d_lock);
hlist_for_each_entry(mark, node, &mnt->mnt_fsnotify_marks, m.m_list) { hlist_for_each_entry(mark, node, &mnt->mnt_fsnotify_marks, m.m_list) {
if (!(mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY))
mark->ignored_mask = 0; mark->ignored_mask = 0;
} }
spin_unlock(&mnt->mnt_root->d_lock); spin_unlock(&mnt->mnt_root->d_lock);
......
...@@ -271,6 +271,7 @@ struct fsnotify_mark { ...@@ -271,6 +271,7 @@ struct fsnotify_mark {
#define FSNOTIFY_MARK_FLAG_INODE 0x01 #define FSNOTIFY_MARK_FLAG_INODE 0x01
#define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02
#define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04
#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08
unsigned int flags; /* vfsmount or inode mark? */ unsigned int flags; /* vfsmount or inode mark? */
void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */ void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment