@@ -496,7 +496,7 @@ int fsnotify_compare_groups(struct fsnotify_group *a, struct fsnotify_group *b)
496496}
497497
498498static int fsnotify_attach_connector_to_object (fsnotify_connp_t * connp ,
499- unsigned int type ,
499+ unsigned int obj_type ,
500500 __kernel_fsid_t * fsid )
501501{
502502 struct inode * inode = NULL ;
@@ -507,7 +507,7 @@ static int fsnotify_attach_connector_to_object(fsnotify_connp_t *connp,
507507 return - ENOMEM ;
508508 spin_lock_init (& conn -> lock );
509509 INIT_HLIST_HEAD (& conn -> list );
510- conn -> type = type ;
510+ conn -> type = obj_type ;
511511 conn -> obj = connp ;
512512 /* Cache fsid of filesystem containing the object */
513513 if (fsid ) {
@@ -572,15 +572,16 @@ static struct fsnotify_mark_connector *fsnotify_grab_connector(
572572 * priority, highest number first, and then by the group's location in memory.
573573 */
574574static int fsnotify_add_mark_list (struct fsnotify_mark * mark ,
575- fsnotify_connp_t * connp , unsigned int type ,
575+ fsnotify_connp_t * connp ,
576+ unsigned int obj_type ,
576577 int allow_dups , __kernel_fsid_t * fsid )
577578{
578579 struct fsnotify_mark * lmark , * last = NULL ;
579580 struct fsnotify_mark_connector * conn ;
580581 int cmp ;
581582 int err = 0 ;
582583
583- if (WARN_ON (!fsnotify_valid_obj_type (type )))
584+ if (WARN_ON (!fsnotify_valid_obj_type (obj_type )))
584585 return - EINVAL ;
585586
586587 /* Backend is expected to check for zero fsid (e.g. tmpfs) */
@@ -592,7 +593,8 @@ static int fsnotify_add_mark_list(struct fsnotify_mark *mark,
592593 conn = fsnotify_grab_connector (connp );
593594 if (!conn ) {
594595 spin_unlock (& mark -> lock );
595- err = fsnotify_attach_connector_to_object (connp , type , fsid );
596+ err = fsnotify_attach_connector_to_object (connp , obj_type ,
597+ fsid );
596598 if (err )
597599 return err ;
598600 goto restart ;
@@ -665,7 +667,7 @@ static int fsnotify_add_mark_list(struct fsnotify_mark *mark,
665667 * event types should be delivered to which group.
666668 */
667669int fsnotify_add_mark_locked (struct fsnotify_mark * mark ,
668- fsnotify_connp_t * connp , unsigned int type ,
670+ fsnotify_connp_t * connp , unsigned int obj_type ,
669671 int allow_dups , __kernel_fsid_t * fsid )
670672{
671673 struct fsnotify_group * group = mark -> group ;
@@ -686,7 +688,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark,
686688 fsnotify_get_mark (mark ); /* for g_list */
687689 spin_unlock (& mark -> lock );
688690
689- ret = fsnotify_add_mark_list (mark , connp , type , allow_dups , fsid );
691+ ret = fsnotify_add_mark_list (mark , connp , obj_type , allow_dups , fsid );
690692 if (ret )
691693 goto err ;
692694
@@ -706,13 +708,14 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark,
706708}
707709
708710int fsnotify_add_mark (struct fsnotify_mark * mark , fsnotify_connp_t * connp ,
709- unsigned int type , int allow_dups , __kernel_fsid_t * fsid )
711+ unsigned int obj_type , int allow_dups ,
712+ __kernel_fsid_t * fsid )
710713{
711714 int ret ;
712715 struct fsnotify_group * group = mark -> group ;
713716
714717 mutex_lock (& group -> mark_mutex );
715- ret = fsnotify_add_mark_locked (mark , connp , type , allow_dups , fsid );
718+ ret = fsnotify_add_mark_locked (mark , connp , obj_type , allow_dups , fsid );
716719 mutex_unlock (& group -> mark_mutex );
717720 return ret ;
718721}
@@ -747,14 +750,14 @@ EXPORT_SYMBOL_GPL(fsnotify_find_mark);
747750
748751/* Clear any marks in a group with given type mask */
749752void fsnotify_clear_marks_by_group (struct fsnotify_group * group ,
750- unsigned int type_mask )
753+ unsigned int obj_type )
751754{
752755 struct fsnotify_mark * lmark , * mark ;
753756 LIST_HEAD (to_free );
754757 struct list_head * head = & to_free ;
755758
756759 /* Skip selection step if we want to clear all marks. */
757- if (type_mask == FSNOTIFY_OBJ_ALL_TYPES_MASK ) {
760+ if (obj_type == FSNOTIFY_OBJ_TYPE_ANY ) {
758761 head = & group -> marks_list ;
759762 goto clear ;
760763 }
@@ -769,7 +772,7 @@ void fsnotify_clear_marks_by_group(struct fsnotify_group *group,
769772 */
770773 mutex_lock_nested (& group -> mark_mutex , SINGLE_DEPTH_NESTING );
771774 list_for_each_entry_safe (mark , lmark , & group -> marks_list , g_list ) {
772- if (( 1U << mark -> connector -> type ) & type_mask )
775+ if (mark -> connector -> type == obj_type )
773776 list_move (& mark -> g_list , & to_free );
774777 }
775778 mutex_unlock (& group -> mark_mutex );
0 commit comments