summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2002-10-30 18:34:28 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-10-30 18:34:28 -0800
commitb2229e8d42ebdc90a05200b31ae12bbe82a7c6b6 (patch)
tree86b4d4aea53568ee4b3226cbebaa66a51b765f37 /include/linux
parent5c7eb9d8a945c36b63022c70686fa51105a7cb8b (diff)
[PATCH] hugetlb fixes andhugetlb fixes and cleanups cleanups
huge_page_release() -- hugepage refcounting free_huge_page() -- separates freeing from inode refcounting unmap_hugepage_range() -- unmapping refcounting hook when locked zap_hugepage_range() -- unmappping refcounting hook when unlocked export setattr_mask() -- hugetlbfs wants to call it export destroy_inode() -- hugetlbfs wants to use it export unmap_vma() -- hugetlbpage.c wants to use it unlock_page() in hugetlbpage.c -- fixes deadlock in hugetlbfs_truncate()
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/hugetlb.h55
-rw-r--r--include/linux/mm.h1
3 files changed, 18 insertions, 40 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9a3e78ba7592..ebda9a38d407 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1147,6 +1147,7 @@ extern int filemap_fdatawrite(struct address_space *);
extern int filemap_fdatawait(struct address_space *);
extern void sync_supers(void);
extern sector_t bmap(struct inode *, sector_t);
+extern int setattr_mask(unsigned int);
extern int notify_change(struct dentry *, struct iattr *);
extern int permission(struct inode *, int);
extern int vfs_permission(struct inode *, int);
@@ -1225,6 +1226,7 @@ static inline struct inode *iget(struct super_block *sb, unsigned long ino)
extern void __iget(struct inode * inode);
extern void clear_inode(struct inode *);
+extern void destroy_inode(struct inode *);
extern struct inode *new_inode(struct super_block *);
extern void remove_suid(struct dentry *);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 2142f1d71899..30fa2437be15 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -8,41 +8,24 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
}
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 free_hugepages(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);
+void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
+void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
+void huge_page_release(struct page *);
#else /* !CONFIG_HUGETLB_PAGE */
static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
{
return 0;
}
-static inline int
-copy_hugetlb_page_range(struct mm_struct *src, struct mm_struct *dst,
- struct vm_area_struct *vma)
-{
- return -ENOSYS;
-}
-
-static inline int
-follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
- struct page **pages, struct vm_area_struct **vmas,
- unsigned long *start, int *len, int i)
-{
- return -ENOSYS;
-}
+#define follow_hugetlb_page(m,v,p,vs,a,b,i) ({ BUG(); 0; })
+#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
+#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
+#define zap_hugepage_range(vma, start, len) BUG()
+#define unmap_hugepage_range(vma, start, end) BUG()
+#define huge_page_release(page) BUG()
-static inline int free_hugepages(struct vm_area_struct *vma)
-{
- return -EINVAL;
-}
-
-static inline int
-hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
-{
- return -ENOSYS;
-}
#endif /* !CONFIG_HUGETLB_PAGE */
#ifdef CONFIG_HUGETLBFS
@@ -50,29 +33,21 @@ extern struct file_operations hugetlbfs_file_operations;
extern struct vm_operations_struct hugetlb_vm_ops;
struct file *hugetlb_zero_setup(size_t);
-static inline int is_file_hugetlb_page(struct file *file)
+static inline int is_file_hugepages(struct file *file)
{
return file->f_op == &hugetlbfs_file_operations;
}
-static inline void set_file_hugetlb_page(struct file *file)
+static inline void set_file_hugepages(struct file *file)
{
file->f_op = &hugetlbfs_file_operations;
}
#else /* !CONFIG_HUGETLBFS */
-static inline int is_file_hugetlb_page(struct file *file)
-{
- return 0;
-}
-static inline void set_file_hugetlb_page(struct file *file)
-{
-}
+#define is_file_hugepages(file) 0
+#define set_file_hugepages(file) BUG()
+#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS)
-static inline struct file *hugetlb_zero_setup(size_t size)
-{
- return ERR_PTR(-ENOSYS);
-}
#endif /* !CONFIG_HUGETLBFS */
#endif /* _LINUX_HUGETLB_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2bb29830371d..4f90977fc9fa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -519,6 +519,7 @@ extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned lon
struct vm_area_struct **pprev);
extern int split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
unsigned long addr, int new_below);
+extern void unmap_vma(struct mm_struct *mm, struct vm_area_struct *area);
/* Look up the first VMA which intersects the interval start_addr..end_addr-1,
NULL if none. Assume start_addr < end_addr. */