| .. | .. |
|---|
| 9 | 9 | atomic_t count; |
|---|
| 10 | 10 | struct ns_common ns; |
|---|
| 11 | 11 | struct mount * root; |
|---|
| 12 | + /* |
|---|
| 13 | + * Traversal and modification of .list is protected by either |
|---|
| 14 | + * - taking namespace_sem for write, OR |
|---|
| 15 | + * - taking namespace_sem for read AND taking .ns_lock. |
|---|
| 16 | + */ |
|---|
| 12 | 17 | struct list_head list; |
|---|
| 18 | + spinlock_t ns_lock; |
|---|
| 13 | 19 | struct user_namespace *user_ns; |
|---|
| 14 | 20 | struct ucounts *ucounts; |
|---|
| 15 | 21 | u64 seq; /* Sequence number to prevent loops */ |
|---|
| .. | .. |
|---|
| 58 | 64 | struct mount *mnt_master; /* slave is on master->mnt_slave_list */ |
|---|
| 59 | 65 | struct mnt_namespace *mnt_ns; /* containing namespace */ |
|---|
| 60 | 66 | struct mountpoint *mnt_mp; /* where is it mounted */ |
|---|
| 61 | | - struct hlist_node mnt_mp_list; /* list mounts with the same mountpoint */ |
|---|
| 67 | + union { |
|---|
| 68 | + struct hlist_node mnt_mp_list; /* list mounts with the same mountpoint */ |
|---|
| 69 | + struct hlist_node mnt_umount; |
|---|
| 70 | + }; |
|---|
| 62 | 71 | struct list_head mnt_umounting; /* list entry for umount propagation */ |
|---|
| 63 | 72 | #ifdef CONFIG_FSNOTIFY |
|---|
| 64 | 73 | struct fsnotify_mark_connector __rcu *mnt_fsnotify_marks; |
|---|
| .. | .. |
|---|
| 68 | 77 | int mnt_group_id; /* peer group identifier */ |
|---|
| 69 | 78 | int mnt_expiry_mark; /* true if marked for expiry */ |
|---|
| 70 | 79 | struct hlist_head mnt_pins; |
|---|
| 71 | | - struct fs_pin mnt_umount; |
|---|
| 72 | | - struct dentry *mnt_ex_mountpoint; |
|---|
| 80 | + struct hlist_head mnt_stuck_children; |
|---|
| 73 | 81 | } __randomize_layout; |
|---|
| 74 | 82 | |
|---|
| 75 | 83 | #define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */ |
|---|
| .. | .. |
|---|
| 131 | 139 | struct mnt_namespace *ns; |
|---|
| 132 | 140 | struct path root; |
|---|
| 133 | 141 | int (*show)(struct seq_file *, struct vfsmount *); |
|---|
| 134 | | - void *cached_mount; |
|---|
| 135 | | - u64 cached_event; |
|---|
| 136 | | - loff_t cached_index; |
|---|
| 142 | + struct mount cursor; |
|---|
| 137 | 143 | }; |
|---|
| 138 | 144 | |
|---|
| 139 | 145 | extern const struct seq_operations mounts_op; |
|---|
| .. | .. |
|---|
| 146 | 152 | |
|---|
| 147 | 153 | return __is_local_mountpoint(dentry); |
|---|
| 148 | 154 | } |
|---|
| 155 | + |
|---|
| 156 | +static inline bool is_anon_ns(struct mnt_namespace *ns) |
|---|
| 157 | +{ |
|---|
| 158 | + return ns->seq == 0; |
|---|
| 159 | +} |
|---|
| 160 | + |
|---|
| 161 | +extern void mnt_cursor_del(struct mnt_namespace *ns, struct mount *cursor); |
|---|