diff --git a/scst/include/backport.h b/scst/include/backport.h index 431855c18..8262575b6 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1143,7 +1143,7 @@ struct percpu_ref; typedef void (percpu_ref_func_t)(struct percpu_ref *); struct percpu_ref { - atomic_long_t count; + atomic_t count; percpu_ref_func_t *release; }; @@ -1152,7 +1152,7 @@ static inline int __must_check percpu_ref_init(struct percpu_ref *ref, gfp_t gfp) { WARN_ON_ONCE(flags != 0); - atomic_long_set(&ref->count, 1); + atomic_set(&ref->count, 1); ref->release = release; return 0; } @@ -1163,12 +1163,12 @@ static inline void percpu_ref_exit(struct percpu_ref *ref) static inline void percpu_ref_get(struct percpu_ref *ref) { - atomic_long_inc(&ref->count); + atomic_inc(&ref->count); } static inline void percpu_ref_put(struct percpu_ref *ref) { - if (unlikely(atomic_long_dec_and_test(&ref->count))) + if (unlikely(atomic_dec_and_test(&ref->count))) ref->release(ref); } @@ -1179,7 +1179,7 @@ static inline void percpu_ref_kill(struct percpu_ref *ref) static inline bool percpu_ref_is_zero(struct percpu_ref *ref) { - return !atomic_long_read(&ref->count); + return !atomic_read(&ref->count); } #endif