]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
fsnotify: fsnotify_obtain_group should be fsnotify_alloc_group
authorEric Paris <eparis@redhat.com>
Fri, 18 Dec 2009 02:24:22 +0000 (21:24 -0500)
committerEric Paris <eparis@redhat.com>
Wed, 28 Jul 2010 13:58:50 +0000 (09:58 -0400)
fsnotify_obtain_group was intended to be able to find an already existing
group.  Nothing uses that functionality.  This just renames it to
fsnotify_alloc_group so it is clear what it is doing.

Signed-off-by: Eric Paris <eparis@redhat.com>
fs/notify/dnotify/dnotify.c
fs/notify/group.c
fs/notify/inotify/inotify_user.c
include/linux/fsnotify_backend.h
kernel/audit_tree.c
kernel/audit_watch.c

index 1f46aeac3387f6540d545bb89e7b19f652e37c81..51e4fe33d6bb2224d4cce8f05939a969f2a1e35a 100644 (file)
@@ -433,7 +433,7 @@ static int __init dnotify_init(void)
        dnotify_struct_cache = KMEM_CACHE(dnotify_struct, SLAB_PANIC);
        dnotify_mark_entry_cache = KMEM_CACHE(dnotify_mark_entry, SLAB_PANIC);
 
-       dnotify_group = fsnotify_obtain_group(0, &dnotify_fsnotify_ops);
+       dnotify_group = fsnotify_alloc_group(0, &dnotify_fsnotify_ops);
        if (IS_ERR(dnotify_group))
                panic("unable to allocate fsnotify group for dnotify\n");
        return 0;
index 934860e98095565858c8f249bc19c9857a47b3e4..1d20d26d5fee18f89f41cfcd0d6e35a1c00bb16a 100644 (file)
@@ -162,16 +162,13 @@ void fsnotify_put_group(struct fsnotify_group *group)
 }
 
 /*
- * Either finds an existing group which matches the group_num, mask, and ops or
- * creates a new group and adds it to the global group list.  In either case we
- * take a reference for the group returned.
+ * Create a new fsnotify_group and hold a reference for the group returned.
  */
-struct fsnotify_group *fsnotify_obtain_group(__u32 mask,
-                                            const struct fsnotify_ops *ops)
+struct fsnotify_group *fsnotify_alloc_group(__u32 mask,
+                                           const struct fsnotify_ops *ops)
 {
        struct fsnotify_group *group;
 
-       /* very low use, simpler locking if we just always alloc */
        group = kzalloc(sizeof(struct fsnotify_group), GFP_KERNEL);
        if (!group)
                return ERR_PTR(-ENOMEM);
@@ -192,7 +189,6 @@ struct fsnotify_group *fsnotify_obtain_group(__u32 mask,
 
        mutex_lock(&fsnotify_grp_mutex);
 
-       /* group not found, add a new one */
        list_add_rcu(&group->group_list, &fsnotify_groups);
        group->on_group_list = 1;
        /* being on the fsnotify_groups list holds one num_marks */
index cae317f5bd9dcd47125be67c27451dbc08ac5891..25a2854186e9178bee550d9955f6df970ca97fd1 100644 (file)
@@ -695,7 +695,7 @@ static struct fsnotify_group *inotify_new_group(struct user_struct *user, unsign
 {
        struct fsnotify_group *group;
 
-       group = fsnotify_obtain_group(0, &inotify_fsnotify_ops);
+       group = fsnotify_alloc_group(0, &inotify_fsnotify_ops);
        if (IS_ERR(group))
                return group;
 
index 57e503d017c83d59ca4d8c173beff7ac1f316717..7d3c03e46862e502982798c572de270bfc239de9 100644 (file)
@@ -305,11 +305,11 @@ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode
 /* must call when a group changes its ->mask */
 extern void fsnotify_recalc_global_mask(void);
 /* get a reference to an existing or create a new group */
-extern struct fsnotify_group *fsnotify_obtain_group(__u32 mask,
+extern struct fsnotify_group *fsnotify_alloc_group(__u32 mask,
                                                    const struct fsnotify_ops *ops);
 /* run all marks associated with this group and update group->mask */
 extern void fsnotify_recalc_group_mask(struct fsnotify_group *group);
-/* drop reference on a group from fsnotify_obtain_group */
+/* drop reference on a group from fsnotify_alloc_group */
 extern void fsnotify_put_group(struct fsnotify_group *group);
 
 /* take a reference to an event */
index 59065e72a2eb1f9d90f896a64e2142606c14a57d..813274d4edada354394d9b94387f9c61b87dcf9b 100644 (file)
@@ -937,7 +937,7 @@ static int __init audit_tree_init(void)
 {
        int i;
 
-       audit_tree_group = fsnotify_obtain_group(0, &audit_tree_ops);
+       audit_tree_group = fsnotify_alloc_group(0, &audit_tree_ops);
        if (IS_ERR(audit_tree_group))
                audit_panic("cannot initialize fsnotify group for rectree watches");
 
index c500104d38c20144473596e39fb0966834274e95..0f03a6ab96edfa6e141086f81eba65b57f8e4a65 100644 (file)
@@ -577,8 +577,8 @@ static const struct fsnotify_ops audit_watch_fsnotify_ops = {
 
 static int __init audit_watch_init(void)
 {
-       audit_watch_group = fsnotify_obtain_group(AUDIT_FS_WATCH,
-                                                 &audit_watch_fsnotify_ops);
+       audit_watch_group = fsnotify_alloc_group(AUDIT_FS_WATCH,
+                                                &audit_watch_fsnotify_ops);
        if (IS_ERR(audit_watch_group)) {
                audit_watch_group = NULL;
                audit_panic("cannot create audit fsnotify group");