]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fsnotify: Remove fsnotify_find_{inode|vfsmount}_mark()
authorJan Kara <jack@suse.cz>
Wed, 21 Dec 2016 15:28:45 +0000 (16:28 +0100)
committerJan Kara <jack@suse.cz>
Mon, 10 Apr 2017 15:37:36 +0000 (17:37 +0200)
These are very thin wrappers, just remove them. Drop
fs/notify/vfsmount_mark.c as it is empty now.

Reviewed-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/Makefile
fs/notify/dnotify/dnotify.c
fs/notify/fanotify/fanotify_user.c
fs/notify/fsnotify.h
fs/notify/inode_mark.c
fs/notify/inotify/inotify_user.c
fs/notify/vfsmount_mark.c [deleted file]
include/linux/fsnotify_backend.h
kernel/audit_tree.c
kernel/audit_watch.c

index 96d3420d0242ba6ab1457c3312a395a57ef3ad86..ebb64a0282d1cb8519b5a4db267f2eae15f5e84d 100644 (file)
@@ -1,5 +1,5 @@
 obj-$(CONFIG_FSNOTIFY)         += fsnotify.o notification.o group.o inode_mark.o \
-                                  mark.o vfsmount_mark.o fdinfo.o
+                                  mark.o fdinfo.o
 
 obj-y                  += dnotify/
 obj-y                  += inotify/
index 5940c75541a75dbf5098e945a89c1976a4c2e4fb..b77d8d049e4d6e884847e6cb626a11d206ab6646 100644 (file)
@@ -157,7 +157,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
        if (!S_ISDIR(inode->i_mode))
                return;
 
-       fsn_mark = fsnotify_find_inode_mark(dnotify_group, inode);
+       fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, dnotify_group);
        if (!fsn_mark)
                return;
        dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
@@ -313,7 +313,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
        mutex_lock(&dnotify_group->mark_mutex);
 
        /* add the new_fsn_mark or find an old one. */
-       fsn_mark = fsnotify_find_inode_mark(dnotify_group, inode);
+       fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, dnotify_group);
        if (fsn_mark) {
                dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
                spin_lock(&fsn_mark->lock);
index 24fa3f24b9ad9b805745b8ab5c95296b43c86364..5a82bbb79f5529d82975456d6289c0b66229f8f5 100644 (file)
@@ -533,7 +533,8 @@ static int fanotify_remove_vfsmount_mark(struct fsnotify_group *group,
        int destroy_mark;
 
        mutex_lock(&group->mark_mutex);
-       fsn_mark = fsnotify_find_vfsmount_mark(group, mnt);
+       fsn_mark = fsnotify_find_mark(&real_mount(mnt)->mnt_fsnotify_marks,
+                                     group);
        if (!fsn_mark) {
                mutex_unlock(&group->mark_mutex);
                return -ENOENT;
@@ -562,7 +563,7 @@ static int fanotify_remove_inode_mark(struct fsnotify_group *group,
        int destroy_mark;
 
        mutex_lock(&group->mark_mutex);
-       fsn_mark = fsnotify_find_inode_mark(group, inode);
+       fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, group);
        if (!fsn_mark) {
                mutex_unlock(&group->mark_mutex);
                return -ENOENT;
@@ -578,7 +579,7 @@ static int fanotify_remove_inode_mark(struct fsnotify_group *group,
        if (destroy_mark)
                fsnotify_free_mark(fsn_mark);
 
-       /* matches the fsnotify_find_inode_mark() */
+       /* matches the fsnotify_find_mark() */
        fsnotify_put_mark(fsn_mark);
 
        return 0;
@@ -646,7 +647,8 @@ static int fanotify_add_vfsmount_mark(struct fsnotify_group *group,
        __u32 added;
 
        mutex_lock(&group->mark_mutex);
-       fsn_mark = fsnotify_find_vfsmount_mark(group, mnt);
+       fsn_mark = fsnotify_find_mark(&real_mount(mnt)->mnt_fsnotify_marks,
+                                     group);
        if (!fsn_mark) {
                fsn_mark = fanotify_add_new_mark(group, NULL, mnt);
                if (IS_ERR(fsn_mark)) {
@@ -683,7 +685,7 @@ static int fanotify_add_inode_mark(struct fsnotify_group *group,
                return 0;
 
        mutex_lock(&group->mark_mutex);
-       fsn_mark = fsnotify_find_inode_mark(group, inode);
+       fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, group);
        if (!fsn_mark) {
                fsn_mark = fanotify_add_new_mark(group, inode, NULL);
                if (IS_ERR(fsn_mark)) {
index 3ec593c32684e8d0e13d10e0382ed28c59e158af..bf012e8ecd14be9fb3d9a526eba95baa9fe7c9be 100644 (file)
@@ -24,10 +24,6 @@ extern struct srcu_struct fsnotify_mark_srcu;
 extern int fsnotify_compare_groups(struct fsnotify_group *a,
                                   struct fsnotify_group *b);
 
-/* Find mark belonging to given group in the list of marks */
-extern struct fsnotify_mark *fsnotify_find_mark(
-                               struct fsnotify_mark_connector __rcu **connp,
-                               struct fsnotify_group *group);
 /* Destroy all marks connected via given connector */
 extern void fsnotify_destroy_marks(struct fsnotify_mark_connector __rcu **connp);
 /* run the list of all marks associated with inode and destroy them */
index bdc15f736082069528aece89940c6955451189d9..5cc317bad08248444ba067bdbd0f026c2ce40622 100644 (file)
 
 #include "../internal.h"
 
-/*
- * given a group and inode, find the mark associated with that combination.
- * if found take a reference to that mark and return it, else return NULL
- */
-struct fsnotify_mark *fsnotify_find_inode_mark(struct fsnotify_group *group,
-                                              struct inode *inode)
-{
-       return fsnotify_find_mark(&inode->i_fsnotify_marks, group);
-}
-
 /**
  * fsnotify_unmount_inodes - an sb is unmounting.  handle any watched inodes.
  * @sb: superblock being unmounted.
index b3b2a464a03cf0ff75d7e3287966578f6fffa2f0..a5e4411362f271aaddd3536d3d303e3f4e5ecf2f 100644 (file)
@@ -506,7 +506,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
 
        mask = inotify_arg_to_mask(arg);
 
-       fsn_mark = fsnotify_find_inode_mark(group, inode);
+       fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, group);
        if (!fsn_mark)
                return -ENOENT;
 
diff --git a/fs/notify/vfsmount_mark.c b/fs/notify/vfsmount_mark.c
deleted file mode 100644 (file)
index 1e692c5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/mount.h>
-#include <linux/mutex.h>
-#include <linux/spinlock.h>
-
-#include <linux/atomic.h>
-
-#include <linux/fsnotify_backend.h>
-#include "fsnotify.h"
-
-/*
- * given a group and vfsmount, find the mark associated with that combination.
- * if found take a reference to that mark and return it, else return NULL
- */
-struct fsnotify_mark *fsnotify_find_vfsmount_mark(struct fsnotify_group *group,
-                                                 struct vfsmount *mnt)
-{
-       struct mount *m = real_mount(mnt);
-
-       return fsnotify_find_mark(&m->mnt_fsnotify_marks, group);
-}
index 7287cba42a6688f9115b627e87baab8794428dad..2ef0e04c5a9d04bc9146d208c61696e1f220b81d 100644 (file)
@@ -341,10 +341,10 @@ extern struct fsnotify_event *fsnotify_remove_first_event(struct fsnotify_group
 /* Calculate mask of events for a list of marks */
 extern void fsnotify_recalc_mask(struct fsnotify_mark_connector *conn);
 extern void fsnotify_init_mark(struct fsnotify_mark *mark, void (*free_mark)(struct fsnotify_mark *mark));
-/* find (and take a reference) to a mark associated with group and inode */
-extern struct fsnotify_mark *fsnotify_find_inode_mark(struct fsnotify_group *group, struct inode *inode);
-/* find (and take a reference) to a mark associated with group and vfsmount */
-extern struct fsnotify_mark *fsnotify_find_vfsmount_mark(struct fsnotify_group *group, struct vfsmount *mnt);
+/* Find mark belonging to given group in the list of marks */
+extern struct fsnotify_mark *fsnotify_find_mark(
+                               struct fsnotify_mark_connector __rcu **connp,
+                               struct fsnotify_group *group);
 /* attach the mark to both the group and the inode */
 extern int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
                             struct inode *inode, struct vfsmount *mnt, int allow_dups);
index d59ed4c9037a35dfc020d4ef77ed4b61f905efc6..3cc5b92de765afef41e17d2012908b5d42bd0983 100644 (file)
@@ -391,7 +391,8 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
        struct node *p;
        int n;
 
-       old_entry = fsnotify_find_inode_mark(audit_tree_group, inode);
+       old_entry = fsnotify_find_mark(&inode->i_fsnotify_marks,
+                                      audit_tree_group);
        if (!old_entry)
                return create_chunk(inode, tree);
 
index 6caaf087801f087a69eef71f7fc582b087d60efa..956fa584c239155dbd2c3364dfa68c3e727708ac 100644 (file)
@@ -102,7 +102,7 @@ static inline struct audit_parent *audit_find_parent(struct inode *inode)
        struct audit_parent *parent = NULL;
        struct fsnotify_mark *entry;
 
-       entry = fsnotify_find_inode_mark(audit_watch_group, inode);
+       entry = fsnotify_find_mark(&inode->i_fsnotify_marks, audit_watch_group);
        if (entry)
                parent = container_of(entry, struct audit_parent, mark);