Date: Fri, 29 Nov 2013 15:33:40 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258744 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs Message-ID: <201311291533.rATFXebw094350@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Fri Nov 29 15:33:40 2013 New Revision: 258744 URL: http://svnweb.freebsd.org/changeset/base/258744 Log: zfs: make zfs_map_page / zfs_unmap_page public MFC after: 15 days Modified: head/sys/cddl/compat/opensolaris/sys/vm.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/compat/opensolaris/sys/vm.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vm.h Fri Nov 29 15:32:53 2013 (r258743) +++ head/sys/cddl/compat/opensolaris/sys/vm.h Fri Nov 29 15:33:40 2013 (r258744) @@ -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_obje 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_ */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 29 15:32:53 2013 (r258743) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 29 15:33:40 2013 (r258744) @@ -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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311291533.rATFXebw094350>