diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-23 15:50:28 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-23 15:50:28 +0000 |
commit | a6cea2fdc20b50422fcfc4141b806b585b7e2956 (patch) | |
tree | 5b955a563c7c14aef5f4f81fe296fc56291b3d2c /sys/cddl | |
parent | d883da7ba4eb9b148404a424cba419d0b2289d47 (diff) | |
download | FreeBSD-src-a6cea2fdc20b50422fcfc4141b806b585b7e2956.zip FreeBSD-src-a6cea2fdc20b50422fcfc4141b806b585b7e2956.tar.gz |
Change the use of hard functions for vm_pager_ok and switch to
const variables.
Sponsored by: EMC / Isilon storage division
Reported by: pjd
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_vm.c | 23 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/vm.h | 6 | ||||
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 6 |
3 files changed, 9 insertions, 26 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c b/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c index 0851dbd..0876680 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c @@ -36,26 +36,9 @@ #include <vm/vm_page.h> #include <vm/vm_pager.h> -int -vm_pagerret_bad(void) -{ - - return (VM_PAGER_BAD); -} - -int -vm_pagerret_error(void) -{ - - return (VM_PAGER_ERROR); -} - -int -vm_pagerret_ok(void) -{ - - return (VM_PAGER_OK); -} +const int zfs_vm_pagerret_bad = VM_PAGER_BAD; +const int zfs_vm_pagerret_error = VM_PAGER_ERROR; +const int zfs_vm_pagerret_ok = VM_PAGER_OK; void zfs_vmobject_assert_wlocked(vm_object_t object) diff --git a/sys/cddl/compat/opensolaris/sys/vm.h b/sys/cddl/compat/opensolaris/sys/vm.h index cb3af87..40e4ffa 100644 --- a/sys/cddl/compat/opensolaris/sys/vm.h +++ b/sys/cddl/compat/opensolaris/sys/vm.h @@ -31,9 +31,9 @@ #ifdef _KERNEL -int vm_pagerret_bad(void); -int vm_pagerret_error(void); -int vm_pagerret_ok(void); +extern const int zfs_vm_pagerret_bad; +extern const int zfs_vm_pagerret_error; +extern const int zfs_vm_pagerret_ok; void zfs_vmobject_assert_wlocked(vm_object_t object); void zfs_vmobject_wlock(vm_object_t object); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index c6c3654..29738d1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -5702,7 +5702,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) vm_page_zero_invalid(mreq, TRUE); zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (vm_pagerret_ok()); + return (zfs_vm_pagerret_ok); } PCPU_INC(cnt.v_vnodein); @@ -5718,7 +5718,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) } zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (vm_pagerret_bad()); + return (zfs_vm_pagerret_bad); } lsize = PAGE_SIZE; @@ -5755,7 +5755,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); - return (error ? vm_pagerret_error() : vm_pagerret_ok()); + return (error ? zfs_vm_pagerret_error : zfs_vm_pagerret_ok); } static int |