aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-05-21 17:01:26 -0400
committerEric Paris <eparis@redhat.com>2009-06-11 14:57:53 -0400
commit3be25f49b9d6a97eae9bcb96d3292072b7658bd8 (patch)
tree36f7d96481a47a6bde3c2f961346e940698111e0 /fs/inode.c
parent90586523eb4b349806887c62ee70685a49415124 (diff)
fsnotify: add marks to inodes so groups can interpret how to handle those inodes
This patch creates a way for fsnotify groups to attach marks to inodes. These marks have little meaning to the generic fsnotify infrastructure and thus their meaning should be interpreted by the group that attached them to the inode's list. dnotify and inotify will make use of these markings to indicate which inodes are of interest to their respective groups. But this implementation has the useful property that in the future other listeners could actually use the marks for the exact opposite reason, aka to indicate which inodes it had NO interest in. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index bca0c618fdb3..54c63ce3de25 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -22,6 +22,7 @@
22#include <linux/cdev.h> 22#include <linux/cdev.h>
23#include <linux/bootmem.h> 23#include <linux/bootmem.h>
24#include <linux/inotify.h> 24#include <linux/inotify.h>
25#include <linux/fsnotify.h>
25#include <linux/mount.h> 26#include <linux/mount.h>
26#include <linux/async.h> 27#include <linux/async.h>
27 28
@@ -189,6 +190,10 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode)
189 inode->i_private = NULL; 190 inode->i_private = NULL;
190 inode->i_mapping = mapping; 191 inode->i_mapping = mapping;
191 192
193#ifdef CONFIG_FSNOTIFY
194 inode->i_fsnotify_mask = 0;
195#endif
196
192 return inode; 197 return inode;
193 198
194out_free_security: 199out_free_security:
@@ -221,6 +226,7 @@ void destroy_inode(struct inode *inode)
221 BUG_ON(inode_has_buffers(inode)); 226 BUG_ON(inode_has_buffers(inode));
222 ima_inode_free(inode); 227 ima_inode_free(inode);
223 security_inode_free(inode); 228 security_inode_free(inode);
229 fsnotify_inode_delete(inode);
224 if (inode->i_sb->s_op->destroy_inode) 230 if (inode->i_sb->s_op->destroy_inode)
225 inode->i_sb->s_op->destroy_inode(inode); 231 inode->i_sb->s_op->destroy_inode(inode);
226 else 232 else
@@ -252,6 +258,9 @@ void inode_init_once(struct inode *inode)
252 INIT_LIST_HEAD(&inode->inotify_watches); 258 INIT_LIST_HEAD(&inode->inotify_watches);
253 mutex_init(&inode->inotify_mutex); 259 mutex_init(&inode->inotify_mutex);
254#endif 260#endif
261#ifdef CONFIG_FSNOTIFY
262 INIT_HLIST_HEAD(&inode->i_fsnotify_mark_entries);
263#endif
255} 264}
256EXPORT_SYMBOL(inode_init_once); 265EXPORT_SYMBOL(inode_init_once);
257 266