Use atomic-long operations instead of looping around cmpxchg(). [akpm@linux-foundation.org: massage atomic.h inclusions] Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Dave Chinner <david@fromorbit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing the changes to include/linux (3 of 4 files). Show all
Unified · Split
| @@ -393,8 +393,8 @@ struct inodes_stat_t { · 392 unmodified lines | |||
| 393 | #include <linux/semaphore.h> | 393 | #include <linux/semaphore.h> |
| 394 | #include <linux/fiemap.h> | 394 | #include <linux/fiemap.h> |
| 395 | #include <linux/rculist_bl.h> | 395 | #include <linux/rculist_bl.h> |
| 396 | #include <linux/shrinker.h> | ||
| 397 | #include <linux/atomic.h> | 396 | #include <linux/atomic.h> |
| 397 | #include <linux/shrinker.h> | ||
| 398 | 398 | ||
| 399 | #include <asm/byteorder.h> | 399 | #include <asm/byteorder.h> |
| 400 | 400 | ||
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include <linux/mmzone.h> | 10 | #include <linux/mmzone.h> |
| 11 | #include <linux/rbtree.h> | 11 | #include <linux/rbtree.h> |
| 12 | #include <linux/prio_tree.h> | 12 | #include <linux/prio_tree.h> |
| 13 | #include <linux/atomic.h> | ||
| 13 | #include <linux/debug_locks.h> | 14 | #include <linux/debug_locks.h> |
| 14 | #include <linux/mm_types.h> | 15 | #include <linux/mm_types.h> |
| 15 | #include <linux/range.h> | 16 | #include <linux/range.h> |
| @@ -35,7 +35,7 @@ struct shrinker { · 34 unmodified lines | |||
| 35 | 35 | ||
| 36 | /* These are for internal use */ | 36 | /* These are for internal use */ |
| 37 | struct list_head list; | 37 | struct list_head list; |
| 38 | long nr; /* objs pending delete */ | 38 | atomic_long_t nr_in_batch; /* objs pending delete */ |
| 39 | }; | 39 | }; |
| 40 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ | 40 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ |
| 41 | extern void register_shrinker(struct shrinker *); | 41 | extern void register_shrinker(struct shrinker *); |