Эх сурвалжийг харах

fsnotify: add vfsmount specific fields to the fsnotify_mark_entry union

vfsmount marks need mostly the same data as inode specific fields, but for
consistency and understandability we put that data in a vfsmount specific
struct inside a union with inode specific data.

Signed-off-by: Eric Paris <eparis@redhat.com>
Eric Paris 15 жил өмнө
parent
commit
4136510dd6

+ 10 - 0
include/linux/fsnotify_backend.h

@@ -235,6 +235,15 @@ struct fsnotify_inode_mark {
 	struct list_head free_i_list;	/* tmp list used when freeing this mark */
 	struct list_head free_i_list;	/* tmp list used when freeing this mark */
 };
 };
 
 
+/*
+ * Mount point specific fields in an fsnotify_mark_entry
+ */
+struct fsnotify_vfsmount_mark {
+	struct vfsmount *mnt;		/* inode this entry is associated with */
+	struct hlist_node m_list;	/* list of mark_entries by inode->i_fsnotify_mark_entries */
+	struct list_head free_m_list;	/* tmp list used when freeing this mark */
+};
+
 /*
 /*
  * a mark is simply an entry attached to an in core inode which allows an
  * a mark is simply an entry attached to an in core inode which allows an
  * fsnotify listener to indicate they are either no longer interested in events
  * fsnotify listener to indicate they are either no longer interested in events
@@ -255,6 +264,7 @@ struct fsnotify_mark_entry {
 	spinlock_t lock;		/* protect group and inode */
 	spinlock_t lock;		/* protect group and inode */
 	union {
 	union {
 		struct fsnotify_inode_mark i;
 		struct fsnotify_inode_mark i;
+		struct fsnotify_vfsmount_mark m;
 	};
 	};
 	struct list_head free_g_list;	/* tmp list used when freeing this mark */
 	struct list_head free_g_list;	/* tmp list used when freeing this mark */
 	void (*free_mark)(struct fsnotify_mark_entry *entry); /* called on final put+free */
 	void (*free_mark)(struct fsnotify_mark_entry *entry); /* called on final put+free */