@@ -175,14 +175,14 @@ static void put_ucounts(struct ucounts *ucounts)
175
175
kfree (ucounts );
176
176
}
177
177
178
- static inline bool atomic_inc_below ( atomic_t * v , int u )
178
+ static inline bool atomic_long_inc_below ( atomic_long_t * v , int u )
179
179
{
180
- int c , old ;
181
- c = atomic_read (v );
180
+ long c , old ;
181
+ c = atomic_long_read (v );
182
182
for (;;) {
183
183
if (unlikely (c >= u ))
184
184
return false;
185
- old = atomic_cmpxchg (v , c , c + 1 );
185
+ old = atomic_long_cmpxchg (v , c , c + 1 );
186
186
if (likely (old == c ))
187
187
return true;
188
188
c = old ;
@@ -196,17 +196,17 @@ struct ucounts *inc_ucount(struct user_namespace *ns, kuid_t uid,
196
196
struct user_namespace * tns ;
197
197
ucounts = get_ucounts (ns , uid );
198
198
for (iter = ucounts ; iter ; iter = tns -> ucounts ) {
199
- int max ;
199
+ long max ;
200
200
tns = iter -> ns ;
201
201
max = READ_ONCE (tns -> ucount_max [type ]);
202
- if (!atomic_inc_below (& iter -> ucount [type ], max ))
202
+ if (!atomic_long_inc_below (& iter -> ucount [type ], max ))
203
203
goto fail ;
204
204
}
205
205
return ucounts ;
206
206
fail :
207
207
bad = iter ;
208
208
for (iter = ucounts ; iter != bad ; iter = iter -> ns -> ucounts )
209
- atomic_dec (& iter -> ucount [type ]);
209
+ atomic_long_dec (& iter -> ucount [type ]);
210
210
211
211
put_ucounts (ucounts );
212
212
return NULL ;
@@ -216,7 +216,7 @@ void dec_ucount(struct ucounts *ucounts, enum ucount_type type)
216
216
{
217
217
struct ucounts * iter ;
218
218
for (iter = ucounts ; iter ; iter = iter -> ns -> ucounts ) {
219
- int dec = atomic_dec_if_positive (& iter -> ucount [type ]);
219
+ long dec = atomic_long_dec_if_positive (& iter -> ucount [type ]);
220
220
WARN_ON_ONCE (dec < 0 );
221
221
}
222
222
put_ucounts (ucounts );
0 commit comments