提交 98612952 编写于 作者: L Lino Sanfilippo 提交者: Eric Paris

fsnotify: introduce fsnotify_get_group()

Introduce fsnotify_get_group() which increments the reference counter of a group.
Signed-off-by: NLino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: NEric Paris <eparis@redhat.com>
上级 d8153d4d
...@@ -62,6 +62,14 @@ void fsnotify_destroy_group(struct fsnotify_group *group) ...@@ -62,6 +62,14 @@ void fsnotify_destroy_group(struct fsnotify_group *group)
fsnotify_final_destroy_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. * Drop a reference to a group. Free it if it's through.
*/ */
......
...@@ -360,8 +360,10 @@ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode ...@@ -360,8 +360,10 @@ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode
/* called from fsnotify listeners, such as fanotify or dnotify */ /* 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); 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 */ /* drop reference on a group from fsnotify_alloc_group */
extern void fsnotify_put_group(struct fsnotify_group *group); extern void fsnotify_put_group(struct fsnotify_group *group);
/* destroy group */ /* destroy group */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册