]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fsnotify: Remove fsnotify_set_mark_{,ignored_}mask_locked()
authorJan Kara <jack@suse.cz>
Wed, 21 Dec 2016 15:03:59 +0000 (16:03 +0100)
committerJan Kara <jack@suse.cz>
Mon, 10 Apr 2017 15:37:36 +0000 (17:37 +0200)
These helpers are now only a simple assignment and just obfuscate
what is going on. Remove them.

Reviewed-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/dnotify/dnotify.c
fs/notify/fanotify/fanotify_user.c
fs/notify/inotify/inotify_user.c
fs/notify/mark.c
include/linux/fsnotify_backend.h

index aba165ae33979bc384653629ad33abd71781d939..5940c75541a75dbf5098e945a89c1976a4c2e4fb 100644 (file)
@@ -52,7 +52,7 @@ struct dnotify_mark {
  */
 static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark)
 {
-       __u32 new_mask, old_mask;
+       __u32 new_mask = 0;
        struct dnotify_struct *dn;
        struct dnotify_mark *dn_mark  = container_of(fsn_mark,
                                                     struct dnotify_mark,
@@ -60,14 +60,11 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark)
 
        assert_spin_locked(&fsn_mark->lock);
 
-       old_mask = fsn_mark->mask;
-       new_mask = 0;
        for (dn = dn_mark->dn; dn != NULL; dn = dn->dn_next)
                new_mask |= (dn->dn_mask & ~FS_DN_MULTISHOT);
-       fsnotify_set_mark_mask_locked(fsn_mark, new_mask);
-
-       if (old_mask == new_mask)
+       if (fsn_mark->mask == new_mask)
                return;
+       fsn_mark->mask = new_mask;
 
        fsnotify_recalc_mask(fsn_mark->connector);
 }
index c5e69870287f10b492119d25bb4c927532615427..cf38a345032fd3bc702a99e2b2a12859c5e4a841 100644 (file)
@@ -511,13 +511,12 @@ static __u32 fanotify_mark_remove_from_mask(struct fsnotify_mark *fsn_mark,
                        tmask &= ~FAN_ONDIR;
 
                oldmask = fsn_mark->mask;
-               fsnotify_set_mark_mask_locked(fsn_mark, tmask);
+               fsn_mark->mask = tmask;
        } else {
                __u32 tmask = fsn_mark->ignored_mask & ~mask;
                if (flags & FAN_MARK_ONDIR)
                        tmask &= ~FAN_ONDIR;
-
-               fsnotify_set_mark_ignored_mask_locked(fsn_mark, tmask);
+               fsn_mark->ignored_mask = tmask;
        }
        *destroy = !(fsn_mark->mask | fsn_mark->ignored_mask);
        spin_unlock(&fsn_mark->lock);
@@ -599,13 +598,13 @@ static __u32 fanotify_mark_add_to_mask(struct fsnotify_mark *fsn_mark,
                        tmask |= FAN_ONDIR;
 
                oldmask = fsn_mark->mask;
-               fsnotify_set_mark_mask_locked(fsn_mark, tmask);
+               fsn_mark->mask = tmask;
        } else {
                __u32 tmask = fsn_mark->ignored_mask | mask;
                if (flags & FAN_MARK_ONDIR)
                        tmask |= FAN_ONDIR;
 
-               fsnotify_set_mark_ignored_mask_locked(fsn_mark, tmask);
+               fsn_mark->ignored_mask = tmask;
                if (flags & FAN_MARK_IGNORED_SURV_MODIFY)
                        fsn_mark->flags |= FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY;
        }
index 05b268ec0f5f6c929e84d4ddf8cce41154daf116..69739b26c7e49a417dd35b939a8164d52826c124 100644 (file)
@@ -513,14 +513,12 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
        i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark);
 
        spin_lock(&fsn_mark->lock);
-
        old_mask = fsn_mark->mask;
        if (add)
-               fsnotify_set_mark_mask_locked(fsn_mark, (fsn_mark->mask | mask));
+               fsn_mark->mask |= mask;
        else
-               fsnotify_set_mark_mask_locked(fsn_mark, mask);
+               fsn_mark->mask = mask;
        new_mask = fsn_mark->mask;
-
        spin_unlock(&fsn_mark->lock);
 
        if (old_mask != new_mask) {
index c4f43a6acd9aac838d67081cb27a704cfe964ba6..ae33e9f91849a523e7bb6436902b33de7f7e5919 100644 (file)
@@ -393,20 +393,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
        fsnotify_free_mark(mark);
 }
 
-void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask)
-{
-       assert_spin_locked(&mark->lock);
-
-       mark->mask = mask;
-}
-
-void fsnotify_set_mark_ignored_mask_locked(struct fsnotify_mark *mark, __u32 mask)
-{
-       assert_spin_locked(&mark->lock);
-
-       mark->ignored_mask = mask;
-}
-
 /*
  * Sorting function for lists of fsnotify marks.
  *
index 744a4b9076f926a9a8719763f9ece10d54962c60..63354cd86a7bef191238a9a2047021c29e6b63a7 100644 (file)
@@ -347,10 +347,6 @@ extern void fsnotify_init_mark(struct fsnotify_mark *mark, void (*free_mark)(str
 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);
-/* set the ignored_mask of a mark */
-extern void fsnotify_set_mark_ignored_mask_locked(struct fsnotify_mark *mark, __u32 mask);
-/* set the mask of a mark (might pin the object into memory */
-extern void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask);
 /* 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);