示例#1
0
static struct page *ocfs2_nopage(struct vm_area_struct * area,
				 unsigned long address,
				 int *type)
{
	struct page *page = NOPAGE_SIGBUS;
	sigset_t blocked, oldset;
	int ret;

	mlog_entry("(area=%p, address=%lu, type=%p)\n", area, address,
		   type);

	/* The best way to deal with signals in this path is
	 * to block them upfront, rather than allowing the
	 * locking paths to return -ERESTARTSYS. */
	sigfillset(&blocked);

	/* We should technically never get a bad ret return
	 * from sigprocmask */
	ret = sigprocmask(SIG_BLOCK, &blocked, &oldset);
	if (ret < 0) {
		mlog_errno(ret);
		goto out;
	}

	page = filemap_nopage(area, address, type);

	ret = sigprocmask(SIG_SETMASK, &oldset, NULL);
	if (ret < 0)
		mlog_errno(ret);
out:
	mlog_exit_ptr(page);
	return page;
}
示例#2
0
STATIC struct page *
xfs_vm_nopage(
	struct vm_area_struct	*area,
	unsigned long		address,
	int			*type)
{
	struct inode	*inode = area->vm_file->f_dentry->d_inode;
	vnode_t		*vp = vn_from_inode(inode);
	xfs_mount_t	*mp = XFS_VFSTOM(vp->v_vfsp);
	int		error;

	ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI);

	error = XFS_SEND_MMAP(mp, area, 0);
	if (error)
		return NULL;

	return filemap_nopage(area, address, type);
}