@@ -78,8 +78,7 @@ static struct kmem_cache *mnt_cache __ro_after_init;
78
78
static DECLARE_RWSEM (namespace_sem );
79
79
static HLIST_HEAD (unmounted ); /* protected by namespace_sem */
80
80
static LIST_HEAD (ex_mountpoints ); /* protected by namespace_sem */
81
- static DEFINE_RWLOCK (mnt_ns_tree_lock );
82
- static seqcount_rwlock_t mnt_ns_tree_seqcount = SEQCNT_RWLOCK_ZERO (mnt_ns_tree_seqcount , & mnt_ns_tree_lock );
81
+ static DEFINE_SEQLOCK (mnt_ns_tree_lock );
83
82
84
83
static struct rb_root mnt_ns_tree = RB_ROOT ; /* protected by mnt_ns_tree_lock */
85
84
static LIST_HEAD (mnt_ns_list ); /* protected by mnt_ns_tree_lock */
@@ -131,14 +130,12 @@ static int mnt_ns_cmp(struct rb_node *a, const struct rb_node *b)
131
130
132
131
static inline void mnt_ns_tree_write_lock (void )
133
132
{
134
- write_lock (& mnt_ns_tree_lock );
135
- write_seqcount_begin (& mnt_ns_tree_seqcount );
133
+ write_seqlock (& mnt_ns_tree_lock );
136
134
}
137
135
138
136
static inline void mnt_ns_tree_write_unlock (void )
139
137
{
140
- write_seqcount_end (& mnt_ns_tree_seqcount );
141
- write_unlock (& mnt_ns_tree_lock );
138
+ write_sequnlock (& mnt_ns_tree_lock );
142
139
}
143
140
144
141
static void mnt_ns_tree_add (struct mnt_namespace * ns )
@@ -163,7 +160,7 @@ static void mnt_ns_tree_add(struct mnt_namespace *ns)
163
160
164
161
static void mnt_ns_release (struct mnt_namespace * ns )
165
162
{
166
- lockdep_assert_not_held (& mnt_ns_tree_lock );
163
+ lockdep_assert_not_held (& mnt_ns_tree_lock . lock );
167
164
168
165
/* keep alive for {list,stat}mount() */
169
166
if (refcount_dec_and_test (& ns -> passive )) {
@@ -225,11 +222,11 @@ static struct mnt_namespace *lookup_mnt_ns(u64 mnt_ns_id)
225
222
226
223
guard (rcu )();
227
224
do {
228
- seq = read_seqcount_begin ( & mnt_ns_tree_seqcount );
225
+ seq = read_seqbegin ( & mnt_ns_tree_lock );
229
226
node = rb_find_rcu (& mnt_ns_id , & mnt_ns_tree , mnt_ns_find );
230
227
if (node )
231
228
break ;
232
- } while (read_seqcount_retry ( & mnt_ns_tree_seqcount , seq ));
229
+ } while (read_seqretry ( & mnt_ns_tree_lock , seq ));
233
230
234
231
if (!node )
235
232
return NULL ;
0 commit comments