diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2011-06-14 11:29:46 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2012-12-11 13:29:44 -0500 |
commit | 986129520479d689962a42c31acdeaf854ac91f5 (patch) | |
tree | 0054f75371764fc0a5cc0d194ea7f85e8b94f9d8 | |
parent | d8153d4d8b7b6141770e1416c4a338161205ed1b (diff) |
fsnotify: introduce fsnotify_get_group()
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>
-rw-r--r-- | fs/notify/group.c | 8 | ||||
-rw-r--r-- | include/linux/fsnotify_backend.h | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/fs/notify/group.c b/fs/notify/group.c index cfda328c3d11..1d57c35f1043 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c | |||
@@ -63,6 +63,14 @@ void fsnotify_destroy_group(struct fsnotify_group *group) | |||
63 | } | 63 | } |
64 | 64 | ||
65 | /* | 65 | /* |
66 | * Get reference to a group. | ||
67 | */ | ||
68 | void fsnotify_get_group(struct fsnotify_group *group) | ||
69 | { | ||
70 | atomic_inc(&group->refcnt); | ||
71 | } | ||
72 | |||
73 | /* | ||
66 | * Drop a reference to a group. Free it if it's through. | 74 | * Drop a reference to a group. Free it if it's through. |
67 | */ | 75 | */ |
68 | void fsnotify_put_group(struct fsnotify_group *group) | 76 | void fsnotify_put_group(struct fsnotify_group *group) |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index d2ad345bdeec..e76cef75295d 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -360,8 +360,10 @@ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode | |||
360 | 360 | ||
361 | /* called from fsnotify listeners, such as fanotify or dnotify */ | 361 | /* called from fsnotify listeners, such as fanotify or dnotify */ |
362 | 362 | ||
363 | /* get a reference to an existing or create a new group */ | 363 | /* create a new group */ |
364 | extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops); | 364 | extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops); |
365 | /* get reference to a group */ | ||
366 | extern void fsnotify_get_group(struct fsnotify_group *group); | ||
365 | /* drop reference on a group from fsnotify_alloc_group */ | 367 | /* drop reference on a group from fsnotify_alloc_group */ |
366 | extern void fsnotify_put_group(struct fsnotify_group *group); | 368 | extern void fsnotify_put_group(struct fsnotify_group *group); |
367 | /* destroy group */ | 369 | /* destroy group */ |