]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fsnotify: introduce fsnotify_get_group()
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Tue, 14 Jun 2011 15:29:46 +0000 (17:29 +0200)
committerEric Paris <eparis@redhat.com>
Mon, 26 Mar 2012 15:15:47 +0000 (11:15 -0400)
Introduce fsnotify_get_group() which increments the reference counter of a group.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
fs/notify/group.c
include/linux/fsnotify_backend.h

index cfda328c3d11035011a639b5a613791bd2df40a2..1d57c35f10431b617dc39c6f7eedc2af18cd5cba 100644 (file)
@@ -62,6 +62,14 @@ void fsnotify_destroy_group(struct fsnotify_group *group)
                fsnotify_final_destroy_group(group);
 }
 
+/*
+ * Get reference to a group.
+ */
+void fsnotify_get_group(struct fsnotify_group *group)
+{
+       atomic_inc(&group->refcnt);
+}
+
 /*
  * Drop a reference to a group.  Free it if it's through.
  */
index afac095210067b9f15b36af3712e02abc5c48a94..a1450b3b3d3be88916ef987aa7ee8e8250fe6e0b 100644 (file)
@@ -360,8 +360,10 @@ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode
 
 /* called from fsnotify listeners, such as fanotify or dnotify */
 
-/* get a reference to an existing or create a new group */
+/* create a new group */
 extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops);
+/* get reference to a group */
+extern void fsnotify_get_group(struct fsnotify_group *group);
 /* drop reference on a group from fsnotify_alloc_group */
 extern void fsnotify_put_group(struct fsnotify_group *group);
 /* destroy group */