sysctl: remove "struct file *" argument of ->proc_handler
[safe/jmp/linux-2.6] / include / linux / hugetlb.h
index af09660..11ab19a 100644 (file)
@@ -10,6 +10,9 @@
 #include <asm/tlbflush.h>
 
 struct ctl_table;
+struct user_struct;
+
+int PageHuge(struct page *page);
 
 static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
 {
@@ -17,11 +20,13 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
 }
 
 void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
-int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
-int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
-int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
+int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
+int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
+int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
 int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
-int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int);
+int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
+                       struct page **, struct vm_area_struct **,
+                       unsigned long *, int *, int, unsigned int flags);
 void unmap_hugepage_range(struct vm_area_struct *,
                        unsigned long, unsigned long, struct page *);
 void __unmap_hugepage_range(struct vm_area_struct *,
@@ -31,7 +36,7 @@ void hugetlb_report_meminfo(struct seq_file *);
 int hugetlb_report_node_meminfo(int, char *);
 unsigned long hugetlb_total_pages(void);
 int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
-                       unsigned long address, int write_access);
+                       unsigned long address, unsigned int flags);
 int hugetlb_reserve_pages(struct inode *inode, long from, long to,
                                                struct vm_area_struct *vma,
                                                int acctflags);
@@ -61,6 +66,11 @@ void hugetlb_change_protection(struct vm_area_struct *vma,
 
 #else /* !CONFIG_HUGETLB_PAGE */
 
+static inline int PageHuge(struct page *page)
+{
+       return 0;
+}
+
 static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
 {
        return 0;
@@ -91,7 +101,7 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
 #define pud_huge(x)    0
 #define is_hugepage_only_range(mm, addr, len)  0
 #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
-#define hugetlb_fault(mm, vma, addr, write)    ({ BUG(); 0; })
+#define hugetlb_fault(mm, vma, addr, flags)    ({ BUG(); 0; })
 
 #define hugetlb_change_protection(vma, address, end, newprot)
 
@@ -102,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
 
 #endif /* !CONFIG_HUGETLB_PAGE */
 
+#define HUGETLB_ANON_FILE "anon_hugepage"
+
+enum {
+       /*
+        * The file will be used as an shm file so shmfs accounting rules
+        * apply
+        */
+       HUGETLB_SHMFS_INODE     = 1,
+       /*
+        * The file is being created on the internal vfs mount and shmfs
+        * accounting rules do not apply
+        */
+       HUGETLB_ANONHUGE_INODE  = 2,
+};
+
 #ifdef CONFIG_HUGETLBFS
 struct hugetlbfs_config {
        uid_t   uid;
@@ -139,7 +164,8 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
 
 extern const struct file_operations hugetlbfs_file_operations;
 extern struct vm_operations_struct hugetlb_vm_ops;
-struct file *hugetlb_file_setup(const char *name, size_t, int);
+struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
+                               struct user_struct **user, int creat_flags);
 int hugetlb_get_quota(struct address_space *mapping, long delta);
 void hugetlb_put_quota(struct address_space *mapping, long delta);
 
@@ -159,9 +185,9 @@ static inline void set_file_hugepages(struct file *file)
 }
 #else /* !CONFIG_HUGETLBFS */
 
-#define is_file_hugepages(file)                0
-#define set_file_hugepages(file)       BUG()
-#define hugetlb_file_setup(name,size)  ERR_PTR(-ENOSYS)
+#define is_file_hugepages(file)                        0
+#define set_file_hugepages(file)               BUG()
+#define hugetlb_file_setup(name,size,acct,user,creat)  ERR_PTR(-ENOSYS)
 
 #endif /* !CONFIG_HUGETLBFS */
 
@@ -176,7 +202,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
 #define HSTATE_NAME_LEN 32
 /* Defines one hugetlb page size */
 struct hstate {
-       int hugetlb_next_nid;
+       int next_nid_to_alloc;
+       int next_nid_to_free;
        unsigned int order;
        unsigned long mask;
        unsigned long max_huge_pages;