aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bitmap.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 16:00:36 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 16:00:36 -0500
commit78a45c6f067824cf5d0a9fedea7339ac2e28603c (patch)
treeb4f78c8b6b9059ddace0a18c11629b8d2045f793 /lib/bitmap.c
parentf96fe225677b3efb74346ebd56fafe3997b02afa (diff)
parent29d293b6007b91a4463f05bc8d0b26e0e65c5816 (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 'lib/bitmap.c')
-rw-r--r--lib/bitmap.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c
index b499ab6ada29..969ae8fbc85b 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -326,30 +326,32 @@ void bitmap_clear(unsigned long *map, unsigned int start, int len)
326} 326}
327EXPORT_SYMBOL(bitmap_clear); 327EXPORT_SYMBOL(bitmap_clear);
328 328
329/* 329/**
330 * bitmap_find_next_zero_area - find a contiguous aligned zero area 330 * bitmap_find_next_zero_area_off - find a contiguous aligned zero area
331 * @map: The address to base the search on 331 * @map: The address to base the search on
332 * @size: The bitmap size in bits 332 * @size: The bitmap size in bits
333 * @start: The bitnumber to start searching at 333 * @start: The bitnumber to start searching at
334 * @nr: The number of zeroed bits we're looking for 334 * @nr: The number of zeroed bits we're looking for
335 * @align_mask: Alignment mask for zero area 335 * @align_mask: Alignment mask for zero area
336 * @align_offset: Alignment offset for zero area.
336 * 337 *
337 * The @align_mask should be one less than a power of 2; the effect is that 338 * The @align_mask should be one less than a power of 2; the effect is that
338 * the bit offset of all zero areas this function finds is multiples of that 339 * the bit offset of all zero areas this function finds plus @align_offset
339 * power of 2. A @align_mask of 0 means no alignment is required. 340 * is multiple of that power of 2.
340 */ 341 */
341unsigned long bitmap_find_next_zero_area(unsigned long *map, 342unsigned long bitmap_find_next_zero_area_off(unsigned long *map,
342 unsigned long size, 343 unsigned long size,
343 unsigned long start, 344 unsigned long start,
344 unsigned int nr, 345 unsigned int nr,
345 unsigned long align_mask) 346 unsigned long align_mask,
347 unsigned long align_offset)
346{ 348{
347 unsigned long index, end, i; 349 unsigned long index, end, i;
348again: 350again:
349 index = find_next_zero_bit(map, size, start); 351 index = find_next_zero_bit(map, size, start);
350 352
351 /* Align allocation */ 353 /* Align allocation */
352 index = __ALIGN_MASK(index, align_mask); 354 index = __ALIGN_MASK(index + align_offset, align_mask) - align_offset;
353 355
354 end = index + nr; 356 end = index + nr;
355 if (end > size) 357 if (end > size)
@@ -361,7 +363,7 @@ again:
361 } 363 }
362 return index; 364 return index;
363} 365}
364EXPORT_SYMBOL(bitmap_find_next_zero_area); 366EXPORT_SYMBOL(bitmap_find_next_zero_area_off);
365 367
366/* 368/*
367 * Bitmap printing & parsing functions: first version by Nadia Yvette Chambers, 369 * Bitmap printing & parsing functions: first version by Nadia Yvette Chambers,