summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDave Jones <davej@tetrachloride.(none)>2003-07-03 16:44:04 +0100
committerDave Jones <davej@tetrachloride.(none)>2003-07-03 16:44:04 +0100
commite127a373fcc6a706c6f6485756167d326654db1c (patch)
tree225c4512dca73b42ebfd7569f7c05619e3ce9362 /include/linux
parent5cfcc0cda8596f3b70a9cb36dd6f3c17b73d6d59 (diff)
parentb9d6ea3caf701a205b626016713f0fe3079afc09 (diff)
Merge tetrachloride.(none):/mnt/raid/src/kernel/2.5/bk-linus
into tetrachloride.(none):/mnt/raid/src/kernel/2.5/cpufreq
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h22
-rw-r--r--include/linux/mman.h3
-rw-r--r--include/linux/mmzone.h7
-rw-r--r--include/linux/security.h16
-rw-r--r--include/linux/slab.h4
5 files changed, 43 insertions, 9 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 492bc8aeb053..d75f64725853 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -339,9 +339,14 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num)
page->flags |= zone_num << ZONE_SHIFT;
}
-static inline void * lowmem_page_address(struct page *page)
+#ifndef CONFIG_DISCONTIGMEM
+/* The array of struct pages - for discontigmem use pgdat->lmem_map */
+extern struct page *mem_map;
+#endif
+
+static inline void *lowmem_page_address(struct page *page)
{
- return __va( ( (page - page_zone(page)->zone_mem_map) + page_zone(page)->zone_start_pfn) << PAGE_SHIFT);
+ return __va(page_to_pfn(page) << PAGE_SHIFT);
}
#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -395,11 +400,6 @@ static inline int page_mapped(struct page *page)
#define VM_FAULT_MINOR 1
#define VM_FAULT_MAJOR 2
-#ifndef CONFIG_DISCONTIGMEM
-/* The array of struct pages - for discontigmem use pgdat->lmem_map */
-extern struct page *mem_map;
-#endif
-
extern void show_free_areas(void);
struct page *shmem_nopage(struct vm_area_struct * vma,
@@ -609,5 +609,13 @@ extern struct page * follow_page(struct mm_struct *mm, unsigned long address,
int write);
extern int remap_page_range(struct vm_area_struct *vma, unsigned long from,
unsigned long to, unsigned long size, pgprot_t prot);
+
+#ifndef CONFIG_DEBUG_PAGEALLOC
+static inline void
+kernel_map_pages(struct page *page, int numpages, int enable)
+{
+}
+#endif
+
#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 474d1c046436..a8956f6588ad 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -9,7 +9,8 @@
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
-extern int vm_enough_memory(long pages);
+extern int sysctl_overcommit_memory;
+extern int sysctl_overcommit_ratio;
extern atomic_t vm_committed_space;
#ifdef CONFIG_SMP
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 21e95664fdf8..e768f7ab8963 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -184,12 +184,17 @@ typedef struct pglist_data {
unsigned long *valid_addr_bitmap;
struct bootmem_data *bdata;
unsigned long node_start_pfn;
- unsigned long node_size;
+ unsigned long node_present_pages; /* total number of physical pages */
+ unsigned long node_spanned_pages; /* total size of physical page
+ range, including holes */
int node_id;
struct pglist_data *pgdat_next;
wait_queue_head_t kswapd_wait;
} pg_data_t;
+#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
+#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages)
+
extern int numnodes;
extern struct pglist_data *pgdat_list;
diff --git a/include/linux/security.h b/include/linux/security.h
index 9589f99c3ef3..4d91dfc52c52 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -49,6 +49,7 @@ extern int cap_bprm_secureexec(struct linux_binprm *bprm);
extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
extern void cap_task_reparent_to_init (struct task_struct *p);
extern int cap_syslog (int type);
+extern int cap_vm_enough_memory (long pages);
static inline int cap_netlink_send (struct sk_buff *skb)
{
@@ -958,6 +959,10 @@ struct swap_info_struct;
* See the syslog(2) manual page for an explanation of the @type values.
* @type contains the type of action.
* Return 0 if permission is granted.
+ * @vm_enough_memory:
+ * Check permissions for allocating a new virtual mapping.
+ * @pages contains the number of pages.
+ * Return 0 if permission is granted.
*
* @register_security:
* allow module stacking.
@@ -989,6 +994,7 @@ struct security_operations {
int (*quotactl) (int cmds, int type, int id, struct super_block * sb);
int (*quota_on) (struct file * f);
int (*syslog) (int type);
+ int (*vm_enough_memory) (long pages);
int (*bprm_alloc_security) (struct linux_binprm * bprm);
void (*bprm_free_security) (struct linux_binprm * bprm);
@@ -1238,6 +1244,11 @@ static inline int security_syslog(int type)
return security_ops->syslog(type);
}
+static inline int security_vm_enough_memory(long pages)
+{
+ return security_ops->vm_enough_memory(pages);
+}
+
static inline int security_bprm_alloc (struct linux_binprm *bprm)
{
return security_ops->bprm_alloc_security (bprm);
@@ -1898,6 +1909,11 @@ static inline int security_syslog(int type)
return cap_syslog(type);
}
+static inline int security_vm_enough_memory(long pages)
+{
+ return cap_vm_enough_memory(pages);
+}
+
static inline int security_bprm_alloc (struct linux_binprm *bprm)
{
return 0;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 843c8d638d29..d797c981f37e 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -114,6 +114,10 @@ extern kmem_cache_t *signal_cachep;
extern kmem_cache_t *sighand_cachep;
extern kmem_cache_t *bio_cachep;
+void ptrinfo(unsigned long addr);
+
+extern atomic_t slab_reclaim_pages;
+
#endif /* __KERNEL__ */
#endif /* _LINUX_SLAB_H */