diff options
| author | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
|---|---|---|
| committer | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
| commit | 5c34202b8bf942da411b6599668a76b07449bbfd (patch) | |
| tree | 5719c361321eaddc8e4f1b0c8a7994f0e9a6fdd3 /fs/hugetlbfs/inode.c | |
| parent | 0d4804b31f91cfbcff6d62af0bc09a893a1c8ae0 (diff) | |
| parent | 1f8a6b658a943b4f04a1fc7b3a420360202c86cd (diff) | |
Merge /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/hugetlbfs/inode.c')
| -rw-r--r-- | fs/hugetlbfs/inode.c | 20 | 
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8c718a3d413..98959b87cdf 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -22,6 +22,7 @@  #include <linux/backing-dev.h>  #include <linux/hugetlb.h>  #include <linux/pagevec.h> +#include <linux/mman.h>  #include <linux/quotaops.h>  #include <linux/slab.h>  #include <linux/dnotify.h> @@ -98,10 +99,7 @@ out:   * Called under down_write(mmap_sem).   */ -#ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA -unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, -		unsigned long len, unsigned long pgoff, unsigned long flags); -#else +#ifndef HAVE_ARCH_HUGETLB_UNMAPPED_AREA  static unsigned long  hugetlb_get_unmapped_area(struct file *file, unsigned long addr,  		unsigned long len, unsigned long pgoff, unsigned long flags) @@ -115,6 +113,12 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,  	if (len > TASK_SIZE)  		return -ENOMEM; +	if (flags & MAP_FIXED) { +		if (prepare_hugepage_range(addr, len, pgoff)) +			return -EINVAL; +		return addr; +	} +  	if (addr) {  		addr = ALIGN(addr, HPAGE_SIZE);  		vma = find_vma(mm, addr); @@ -453,7 +457,7 @@ static int hugetlbfs_symlink(struct inode *dir,   */  static int hugetlbfs_set_page_dirty(struct page *page)  { -	struct page *head = (struct page *)page_private(page); +	struct page *head = compound_head(page);  	SetPageDirty(head);  	return 0; @@ -552,8 +556,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)  {  	struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo; -	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == -	    SLAB_CTOR_CONSTRUCTOR) +	if (flags & SLAB_CTOR_CONSTRUCTOR)  		inode_init_once(&ei->vfs_inode);  } @@ -744,6 +747,9 @@ struct file *hugetlb_zero_setup(size_t size)  	char buf[16];  	static atomic_t counter; +	if (!hugetlbfs_vfsmount) +		return ERR_PTR(-ENOENT); +  	if (!can_do_hugetlb_shm())  		return ERR_PTR(-EPERM);  | 
