zfs: make zfs_map_page / zfs_unmap_page public

MFC after:	15 days
This commit is contained in:
Andriy Gapon 2013-11-29 15:33:40 +00:00
parent 998a42756c
commit fdbcc95a47
2 changed files with 15 additions and 16 deletions

View File

@ -31,6 +31,8 @@
#ifdef _KERNEL
#include <sys/sf_buf.h>
extern const int zfs_vm_pagerret_bad;
extern const int zfs_vm_pagerret_error;
extern const int zfs_vm_pagerret_ok;
@ -39,6 +41,19 @@ void zfs_vmobject_assert_wlocked(vm_object_t object);
void zfs_vmobject_wlock(vm_object_t object);
void zfs_vmobject_wunlock(vm_object_t object);
static inline caddr_t
zfs_map_page(vm_page_t pp, struct sf_buf **sfp)
{
*sfp = sf_buf_alloc(pp, 0);
return ((caddr_t)sf_buf_kva(*sfp));
}
static inline void
zfs_unmap_page(struct sf_buf *sf)
{
sf_buf_free(sf);
}
#endif /* _KERNEL */
#endif /* _OPENSOLARIS_SYS_VM_H_ */

View File

@ -71,7 +71,6 @@
#include <sys/kidmap.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/sf_buf.h>
#include <sys/sched.h>
#include <sys/acl.h>
#include <vm/vm_param.h>
@ -452,21 +451,6 @@ page_unhold(vm_page_t pp)
vm_page_unlock(pp);
}
static caddr_t
zfs_map_page(vm_page_t pp, struct sf_buf **sfp)
{
*sfp = sf_buf_alloc(pp, 0);
return ((caddr_t)sf_buf_kva(*sfp));
}
static void
zfs_unmap_page(struct sf_buf *sf)
{
sf_buf_free(sf);
}
/*
* When a file is memory mapped, we must keep the IO data synchronized
* between the DMU cache and the memory mapped pages. What this means: