diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:00:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:00:36 -0500 |
commit | 78a45c6f067824cf5d0a9fedea7339ac2e28603c (patch) | |
tree | b4f78c8b6b9059ddace0a18c11629b8d2045f793 /include/linux/bitmap.h | |
parent | f96fe225677b3efb74346ebd56fafe3997b02afa (diff) | |
parent | 29d293b6007b91a4463f05bc8d0b26e0e65c5816 (diff) |
Merge branch 'akpm' (second patch-bomb from Andrew)
Merge second patchbomb from Andrew Morton:
- the rest of MM
- misc fs fixes
- add execveat() syscall
- new ratelimit feature for fault-injection
- decompressor updates
- ipc/ updates
- fallocate feature creep
- fsnotify cleanups
- a few other misc things
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (99 commits)
cgroups: Documentation: fix trivial typos and wrong paragraph numberings
parisc: percpu: update comments referring to __get_cpu_var
percpu: update local_ops.txt to reflect this_cpu operations
percpu: remove __get_cpu_var and __raw_get_cpu_var macros
fsnotify: remove destroy_list from fsnotify_mark
fsnotify: unify inode and mount marks handling
fallocate: create FAN_MODIFY and IN_MODIFY events
mm/cma: make kmemleak ignore CMA regions
slub: fix cpuset check in get_any_partial
slab: fix cpuset check in fallback_alloc
shmdt: use i_size_read() instead of ->i_size
ipc/shm.c: fix overly aggressive shmdt() when calls span multiple segments
ipc/msg: increase MSGMNI, remove scaling
ipc/sem.c: increase SEMMSL, SEMMNI, SEMOPM
ipc/sem.c: change memory barrier in sem_lock() to smp_rmb()
lib/decompress.c: consistency of compress formats for kernel image
decompress_bunzip2: off by one in get_next_block()
usr/Kconfig: make initrd compression algorithm selection not expert
fault-inject: add ratelimit option
ratelimit: add initialization macro
...
Diffstat (limited to 'include/linux/bitmap.h')
-rw-r--r-- | include/linux/bitmap.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index e1c8d080c427..34e020c23644 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -45,6 +45,7 @@ | |||
45 | * bitmap_set(dst, pos, nbits) Set specified bit area | 45 | * bitmap_set(dst, pos, nbits) Set specified bit area |
46 | * bitmap_clear(dst, pos, nbits) Clear specified bit area | 46 | * bitmap_clear(dst, pos, nbits) Clear specified bit area |
47 | * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area | 47 | * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area |
48 | * bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above | ||
48 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n | 49 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n |
49 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n | 50 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n |
50 | * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) | 51 | * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) |
@@ -114,11 +115,36 @@ extern int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits); | |||
114 | 115 | ||
115 | extern void bitmap_set(unsigned long *map, unsigned int start, int len); | 116 | extern void bitmap_set(unsigned long *map, unsigned int start, int len); |
116 | extern void bitmap_clear(unsigned long *map, unsigned int start, int len); | 117 | extern void bitmap_clear(unsigned long *map, unsigned int start, int len); |
117 | extern unsigned long bitmap_find_next_zero_area(unsigned long *map, | 118 | |
118 | unsigned long size, | 119 | extern unsigned long bitmap_find_next_zero_area_off(unsigned long *map, |
119 | unsigned long start, | 120 | unsigned long size, |
120 | unsigned int nr, | 121 | unsigned long start, |
121 | unsigned long align_mask); | 122 | unsigned int nr, |
123 | unsigned long align_mask, | ||
124 | unsigned long align_offset); | ||
125 | |||
126 | /** | ||
127 | * bitmap_find_next_zero_area - find a contiguous aligned zero area | ||
128 | * @map: The address to base the search on | ||
129 | * @size: The bitmap size in bits | ||
130 | * @start: The bitnumber to start searching at | ||
131 | * @nr: The number of zeroed bits we're looking for | ||
132 | * @align_mask: Alignment mask for zero area | ||
133 | * | ||
134 | * The @align_mask should be one less than a power of 2; the effect is that | ||
135 | * the bit offset of all zero areas this function finds is multiples of that | ||
136 | * power of 2. A @align_mask of 0 means no alignment is required. | ||
137 | */ | ||
138 | static inline unsigned long | ||
139 | bitmap_find_next_zero_area(unsigned long *map, | ||
140 | unsigned long size, | ||
141 | unsigned long start, | ||
142 | unsigned int nr, | ||
143 | unsigned long align_mask) | ||
144 | { | ||
145 | return bitmap_find_next_zero_area_off(map, size, start, nr, | ||
146 | align_mask, 0); | ||
147 | } | ||
122 | 148 | ||
123 | extern int bitmap_scnprintf(char *buf, unsigned int len, | 149 | extern int bitmap_scnprintf(char *buf, unsigned int len, |
124 | const unsigned long *src, int nbits); | 150 | const unsigned long *src, int nbits); |