diff options
Diffstat (limited to 'fs/hugetlbfs/inode.c')
| -rw-r--r-- | fs/hugetlbfs/inode.c | 28 | 
1 files changed, 13 insertions, 15 deletions
| diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index e4de5425838d..09d4baef29cf 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -150,10 +150,10 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)  	if (inode->i_flags & S_PRIVATE)  		vm_flags |= VM_NORESERVE; -	if (!hugetlb_reserve_pages(inode, +	if (hugetlb_reserve_pages(inode,  				vma->vm_pgoff >> huge_page_order(h),  				len >> huge_page_shift(h), vma, -				vm_flags)) +				vm_flags) < 0)  		goto out;  	ret = 0; @@ -179,12 +179,8 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,  	if (len & ~huge_page_mask(h))  		return -EINVAL; -	if (flags & MAP_FIXED) { -		if (addr & ~huge_page_mask(h)) -			return -EINVAL; -		if (prepare_hugepage_range(file, addr, len)) -			return -EINVAL; -	} +	if ((flags & MAP_FIXED) && (addr & ~huge_page_mask(h))) +		return -EINVAL;  	if (addr)  		addr0 = ALIGN(addr, huge_page_size(h)); @@ -311,7 +307,7 @@ static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to)  	return retval;  } -static int hugetlbfs_write_begin(struct file *file, +static int hugetlbfs_write_begin(const struct kiocb *iocb,  			struct address_space *mapping,  			loff_t pos, unsigned len,  			struct folio **foliop, void **fsdata) @@ -319,9 +315,10 @@ static int hugetlbfs_write_begin(struct file *file,  	return -EINVAL;  } -static int hugetlbfs_write_end(struct file *file, struct address_space *mapping, -			loff_t pos, unsigned len, unsigned copied, -			struct folio *folio, void *fsdata) +static int hugetlbfs_write_end(const struct kiocb *iocb, +			       struct address_space *mapping, +			       loff_t pos, unsigned len, unsigned copied, +			       struct folio *folio, void *fsdata)  {  	BUG();  	return -EINVAL; @@ -1433,6 +1430,7 @@ hugetlbfs_fill_super(struct super_block *sb, struct fs_context *fc)  	sb->s_blocksize_bits = huge_page_shift(ctx->hstate);  	sb->s_magic = HUGETLBFS_MAGIC;  	sb->s_op = &hugetlbfs_ops; +	sb->s_d_flags = DCACHE_DONTCACHE;  	sb->s_time_gran = 1;  	/* @@ -1561,9 +1559,9 @@ struct file *hugetlb_file_setup(const char *name, size_t size,  	inode->i_size = size;  	clear_nlink(inode); -	if (!hugetlb_reserve_pages(inode, 0, +	if (hugetlb_reserve_pages(inode, 0,  			size >> huge_page_shift(hstate_inode(inode)), NULL, -			acctflag)) +			acctflag) < 0)  		file = ERR_PTR(-ENOMEM);  	else  		file = alloc_file_pseudo(inode, mnt, name, O_RDWR, @@ -1587,7 +1585,7 @@ static struct vfsmount *__init mount_one_hugetlbfs(struct hstate *h)  	} else {  		struct hugetlbfs_fs_context *ctx = fc->fs_private;  		ctx->hstate = h; -		mnt = fc_mount(fc); +		mnt = fc_mount_longterm(fc);  		put_fs_context(fc);  	}  	if (IS_ERR(mnt)) | 
