On Wed, 12 Nov 2014 17:07:42 +0100 Jan Kara <jack@xxxxxxx> wrote: > There's lot of common code in inode and mount marks handling. Factor it > out to common helper function. Confused. > --- a/fs/notify/inode_mark.c > +++ b/fs/notify/inode_mark.c > @@ -31,28 +31,13 @@ > #include "../internal.h" > > /* > - * Recalculate the mask of events relevant to a given inode locked. > - */ > -static void fsnotify_recalc_inode_mask_locked(struct inode *inode) > -{ > - struct fsnotify_mark *mark; > - __u32 new_mask = 0; > - > - assert_spin_locked(&inode->i_lock); > - > - hlist_for_each_entry(mark, &inode->i_fsnotify_marks, i.i_list) > - new_mask |= mark->mask; > - inode->i_fsnotify_mask = new_mask; > -} Gone. > @@ -202,36 +153,9 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, > assert_spin_locked(&mark->lock); > > spin_lock(&inode->i_lock); > - > - mark->i.inode = inode; > - > - /* is mark the first mark? */ > - if (hlist_empty(&inode->i_fsnotify_marks)) { > - hlist_add_head_rcu(&mark->i.i_list, &inode->i_fsnotify_marks); > - goto out; > - } > - > - /* should mark be in the middle of the current list? */ > - hlist_for_each_entry(lmark, &inode->i_fsnotify_marks, i.i_list) { > - last = lmark; > - > - if ((lmark->group == group) && !allow_dups) { > - ret = -EEXIST; > - goto out; > - } > - > - cmp = fsnotify_compare_groups(lmark->group, mark->group); > - if (cmp < 0) > - continue; > - > - hlist_add_before_rcu(&mark->i.i_list, &lmark->i.i_list); > - goto out; > - } > - > - BUG_ON(last == NULL); > - /* mark should be the last entry. last is the current last entry */ > - hlist_add_behind_rcu(&mark->i.i_list, &last->i.i_list); > -out: > + mark->inode = inode; > + ret = fsnotify_add_mark_list(&inode->i_fsnotify_marks, mark, > + allow_dups); > fsnotify_recalc_inode_mask_locked(inode); But not forgotten. The compiler noticed this ;) I'll drop fsnotify-unify-inode-and-mount-marks-handling.patch and fsnotify-remove-destroy_list-from-fsnotify_mark.patch - could you take a look please? I had to stage those two patches after linux-next.patch because someone has been fiddling with fs/notify/ in -next, causing conflicts. Perhaps that had something to do with it, but I don't see how. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html