(void) __mm_populate(addr, len, 1);
}
extern void mm_populate_vma(struct vm_area_struct *vma, unsigned long start,
- unsigned long end);
+ unsigned long end);
#else
static inline void mm_populate(unsigned long addr, unsigned long len) {}
-extern void mm_populate_vma(struct vm_area_struct *vma, unsigned long start,
- unsigned long end) {}
+void mm_populate_vma(struct vm_area_struct *vma, unsigned long start,
+ unsigned long end) {}
#endif
/* These take the mm semaphore themselves */
/* Look up the first VMA which intersects the interval start_addr..end_addr-1,
NULL if none. Assume start_addr < end_addr. */
-extern struct vm_area_struct * find_vma_intersection(struct mm_struct * mm,
- unsigned long start_addr,
- unsigned long end_addr);
+extern struct vm_area_struct *find_vma_intersection(struct mm_struct *mm,
+ unsigned long start_addr, unsigned long end_addr);
static inline unsigned long vm_start_gap(struct vm_area_struct *vma)
{
extern void __dump_page(struct page *page, const char *reason);
void dump_vma(const struct vm_area_struct *vma);
void dump_mm(const struct mm_struct *mm);
-#define CONFIG_DEBUG_VM 1
+
#ifdef CONFIG_DEBUG_VM
#define VM_BUG_ON(cond) BUG_ON(cond)
#define VM_BUG_ON_PAGE(cond, page) \
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/list.h>
-#include <linux/local_lock.h>
#include <linux/percpu.h>
#include <linux/preempt.h>
#include <linux/rcupdate.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/xarray.h>
+#include <linux/local_lock.h>
/* Keep unconverted code working */
#define radix_tree_root xarray
return ((unsigned long)entry & 3) == 2;
}
-#define XA_ZERO_ENTRY xa_mk_internal(259)
+#define XA_ZERO_ENTRY xa_mk_internal(257)
/**
* xa_is_zero() - Is the entry a zero entry?
return unlikely(entry == XA_RETRY_ENTRY);
}
-#define XA_SKIP_ENTRY xa_mk_internal(257)
-
-/**
- * xa_is_skip() - Is the entry a skip entry?
- * @entry: Entry retrieved from the XArray
- *
- * Return: %true if the entry is a skip entry.
- */
-static inline bool xa_is_skip(const void *entry)
-{
- return unlikely(entry == XA_SKIP_ENTRY);
-}
-
-#define XA_DELETED_ENTRY xa_mk_internal(258)
-
-/**
- * xa_is_deleted() - has the entry been deleted?
- * @entry: Entry retrieved from the XArray
- *
- * Return: %true if the entry has been deleted.
- */
-static inline bool xa_is_deleted(const void *entry)
-{
- return unlikely(entry == XA_DELETED_ENTRY);
-}
-
/**
* xa_is_advanced() - Is the entry only permitted for the advanced API?
* @entry: Entry to be stored in the XArray.
*/
static inline bool xa_is_advanced(const void *entry)
{
- return xa_is_internal(entry) && (entry < XA_ZERO_ENTRY);
+ return xa_is_internal(entry) && (entry <= XA_RETRY_ENTRY);
}
/**
goto out;
/* Ok, looks good - let it rip. */
- if (do_brk_flags(&mas, &brkvma, oldbrk, newbrk-oldbrk, 0) < 0) {
+ if (do_brk_flags(&mas, &brkvma, oldbrk, newbrk-oldbrk, 0) < 0)
goto out;
- }
+
mm->brk = brk;
success:
vma->vm_pgoff = pgoff;
if (adjust_next) {
- // maple tree erase is unnecessary as the adjusting of the vma
- // would have overwritten the area.
next->vm_start += adjust_next;
next->vm_pgoff += adjust_next >> PAGE_SHIFT;
- // the vma_store is necessary as the adjust_next may be
- // negative and expand backwards.
vma_mt_store(mm, next);
}
if (brkvma) {
vma = *brkvma;
/* Fast path, expand the existing vma if possible */
- if (vma && ((vma->vm_flags & ~VM_SOFTDIRTY) == flags)){
+ if (vma && ((vma->vm_flags & ~VM_SOFTDIRTY) == flags)) {
vma->vm_end = addr + len;
mas->index = vma->vm_start;
mas->last = vma->vm_end - 1;