From 888636655ddddb9e8ae3afb998c72fd2c99f63d5 Mon Sep 17 00:00:00 2001
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Tue, 15 Sep 2020 22:00:58 +0000
Subject: [PATCH] vfs_subr.c: export io_hold_cnt and vn_read_from_obj().

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D26346
---
 sys/kern/vfs_vnops.c | 4 ++--
 sys/sys/vnode.h      | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 9bfd077fff1e..4498dd8f4c58 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -125,7 +125,7 @@ struct 	fileops vnops = {
 	.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE
 };
 
-static const int io_hold_cnt = 16;
+const u_int io_hold_cnt = 16;
 static int vn_io_fault_enable = 1;
 SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RWTUN,
     &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance");
@@ -848,7 +848,7 @@ get_advice(struct file *fp, struct uio *uio)
 	return (ret);
 }
 
-static int
+int
 vn_read_from_obj(struct vnode *vp, struct uio *uio)
 {
 	vm_object_t obj;
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 7edea6c1e588..bdeb5287c1db 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -392,6 +392,7 @@ MALLOC_DECLARE(M_VNODE);
 #endif
 
 extern u_int ncsizefactor;
+extern const u_int io_hold_cnt;
 
 /*
  * Convert between vnode types and inode formats (since POSIX.1
@@ -734,7 +735,8 @@ int	vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base,
 	    size_t len, off_t offset, enum uio_seg segflg, int ioflg,
 	    struct ucred *active_cred, struct ucred *file_cred, size_t *aresid,
 	    struct thread *td);
-int	vn_rlimit_fsize(const struct vnode *vn, const struct uio *uio,
+int	vn_read_from_obj(struct vnode *vp, struct uio *uio);
+int	vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio,
 	    struct thread *td);
 int	vn_start_write(struct vnode *vp, struct mount **mpp, int flags);
 int	vn_start_secondary_write(struct vnode *vp, struct mount **mpp,