]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/hugetlb.h
hugetlbfs: allow the creation of files suitable for MAP_PRIVATE on the vfs internal...
[net-next-2.6.git] / include / linux / hugetlb.h
index 5cbc620bdfe060dba93399143b5d76e354093dc7..f6505ad866579fee86ce36defb4a150cc74c9ce0 100644 (file)
@@ -24,7 +24,9 @@ int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *
 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 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 *,
@@ -110,6 +112,14 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
 
 #endif /* !CONFIG_HUGETLB_PAGE */
 
+enum {
+       /*
+        * The file will be used as an shm file so shmfs accounting rules
+        * apply
+        */
+       HUGETLB_SHMFS_INODE     = 1,
+};
+
 #ifdef CONFIG_HUGETLBFS
 struct hugetlbfs_config {
        uid_t   uid;
@@ -148,7 +158,7 @@ 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 size, int acct,
-                                               struct user_struct **user);
+                               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);
 
@@ -170,7 +180,7 @@ static inline void set_file_hugepages(struct file *file)
 
 #define is_file_hugepages(file)                        0
 #define set_file_hugepages(file)               BUG()
-#define hugetlb_file_setup(name,size,acct,user)        ERR_PTR(-ENOSYS)
+#define hugetlb_file_setup(name,size,acct,user,creat)  ERR_PTR(-ENOSYS)
 
 #endif /* !CONFIG_HUGETLBFS */
 
@@ -185,7 +195,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;