Page MenuHomeFreeBSD

D39127.diff
No OneTemporary

D39127.diff

diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3
--- a/lib/libc/gen/sysctl.3
+++ b/lib/libc/gen/sysctl.3
@@ -28,7 +28,7 @@
.\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95
.\" $FreeBSD$
.\"
-.Dd October 18, 2021
+.Dd March 16, 2023
.Dt SYSCTL 3
.Os
.Sh NAME
@@ -354,7 +354,6 @@
.It Dv KERN_SECURELVL Ta integer Ta raise only
.It Dv KERN_UPDATEINTERVAL Ta integer Ta no
.It Dv KERN_VERSION Ta string Ta no
-.It Dv KERN_VNODE Ta struct xvnode Ta no
.El
.Bl -tag -width 6n
.It Li KERN_ARGMAX
@@ -487,14 +486,6 @@
It may not be lowered.
.It Li KERN_VERSION
The system version string.
-.It Li KERN_VNODE
-Return the entire vnode table.
-Note, the vnode table is not necessarily a consistent snapshot of
-the system.
-The returned data consists of an array whose size depends on the
-current number of such objects in the system.
-Each element of the array consists of a
-.Va struct xvnode .
.El
.Ss CTL_NET
The string and integer information available for the CTL_NET level
diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c
--- a/sys/kern/kern_xxx.c
+++ b/sys/kern/kern_xxx.c
@@ -111,7 +111,7 @@
#define KINFO_PROC (0<<8)
#define KINFO_RT (1<<8)
-#define KINFO_VNODE (2<<8)
+/* UNUSED, was KINFO_VNODE (2<<8) */
#define KINFO_FILE (3<<8)
#define KINFO_METER (4<<8)
#define KINFO_LOADAVG (5<<8)
@@ -184,13 +184,6 @@
0, 0, 0, &size, 0);
break;
- case KINFO_VNODE:
- name[0] = CTL_KERN;
- name[1] = KERN_VNODE;
- error = userland_sysctl(td, name, 2, uap->where, uap->size,
- 0, 0, 0, &size, 0);
- break;
-
case KINFO_PROC:
name[0] = CTL_KERN;
name[1] = KERN_PROC;
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -4704,103 +4704,6 @@
#endif /* 1 || COMPAT_PRELITE2 */
#endif /* !BURN_BRIDGES */
-#define KINFO_VNODESLOP 10
-#ifdef notyet
-/*
- * Dump vnode list (via sysctl).
- */
-/* ARGSUSED */
-static int
-sysctl_vnode(SYSCTL_HANDLER_ARGS)
-{
- struct xvnode *xvn;
- struct mount *mp;
- struct vnode *vp;
- int error, len, n;
-
- /*
- * Stale numvnodes access is not fatal here.
- */
- req->lock = 0;
- len = (numvnodes + KINFO_VNODESLOP) * sizeof *xvn;
- if (!req->oldptr)
- /* Make an estimate */
- return (SYSCTL_OUT(req, 0, len));
-
- error = sysctl_wire_old_buffer(req, 0);
- if (error != 0)
- return (error);
- xvn = malloc(len, M_TEMP, M_ZERO | M_WAITOK);
- n = 0;
- mtx_lock(&mountlist_mtx);
- TAILQ_FOREACH(mp, &mountlist, mnt_list) {
- if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK))
- continue;
- MNT_ILOCK(mp);
- TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) {
- if (n == len)
- break;
- vref(vp);
- xvn[n].xv_size = sizeof *xvn;
- xvn[n].xv_vnode = vp;
- xvn[n].xv_id = 0; /* XXX compat */
-#define XV_COPY(field) xvn[n].xv_##field = vp->v_##field
- XV_COPY(usecount);
- XV_COPY(writecount);
- XV_COPY(holdcnt);
- XV_COPY(mount);
- XV_COPY(numoutput);
- XV_COPY(type);
-#undef XV_COPY
- xvn[n].xv_flag = vp->v_vflag;
-
- switch (vp->v_type) {
- case VREG:
- case VDIR:
- case VLNK:
- break;
- case VBLK:
- case VCHR:
- if (vp->v_rdev == NULL) {
- vrele(vp);
- continue;
- }
- xvn[n].xv_dev = dev2udev(vp->v_rdev);
- break;
- case VSOCK:
- xvn[n].xv_socket = vp->v_socket;
- break;
- case VFIFO:
- xvn[n].xv_fifo = vp->v_fifoinfo;
- break;
- case VNON:
- case VBAD:
- default:
- /* shouldn't happen? */
- vrele(vp);
- continue;
- }
- vrele(vp);
- ++n;
- }
- MNT_IUNLOCK(mp);
- mtx_lock(&mountlist_mtx);
- vfs_unbusy(mp);
- if (n == len)
- break;
- }
- mtx_unlock(&mountlist_mtx);
-
- error = SYSCTL_OUT(req, xvn, n * sizeof *xvn);
- free(xvn, M_TEMP);
- return (error);
-}
-
-SYSCTL_PROC(_kern, KERN_VNODE, vnode, CTLTYPE_OPAQUE | CTLFLAG_RD |
- CTLFLAG_MPSAFE, 0, 0, sysctl_vnode, "S,xvnode",
- "");
-#endif
-
static void
unmount_or_warn(struct mount *mp)
{
diff --git a/sys/security/audit/audit_bsm_klib.c b/sys/security/audit/audit_bsm_klib.c
--- a/sys/security/audit/audit_bsm_klib.c
+++ b/sys/security/audit/audit_bsm_klib.c
@@ -182,7 +182,6 @@
case KERN_HOSTID:
case KERN_SECURELVL:
case KERN_HOSTNAME:
- case KERN_VNODE:
case KERN_PROC:
case KERN_FILE:
case KERN_PROF:
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -972,7 +972,7 @@
#define KERN_HOSTNAME 10 /* string: hostname */
#define KERN_HOSTID 11 /* int: host identifier */
#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
-#define KERN_VNODE 13 /* struct: vnode structures */
+/* was: #define KERN_VNODE 13 ; disabled in 2003 and removed in 2023 */
#define KERN_PROC 14 /* struct: process entries */
#define KERN_FILE 15 /* struct: file entries */
#define KERN_PROF 16 /* node: kernel profiling info */
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -199,36 +199,6 @@
/* XXX: These are temporary to avoid a source sweep at this time */
#define v_object v_bufobj.bo_object
-/*
- * Userland version of struct vnode, for sysctl.
- */
-struct xvnode {
- size_t xv_size; /* sizeof(struct xvnode) */
- void *xv_vnode; /* address of real vnode */
- u_long xv_flag; /* vnode vflags */
- int xv_usecount; /* reference count of users */
- int xv_writecount; /* reference count of writers */
- int xv_holdcnt; /* page & buffer references */
- u_long xv_id; /* capability identifier */
- void *xv_mount; /* address of parent mount */
- long xv_numoutput; /* num of writes in progress */
- enum vtype xv_type; /* vnode type */
- union {
- void *xvu_socket; /* unpcb, if VSOCK */
- void *xvu_fifo; /* fifo, if VFIFO */
- dev_t xvu_rdev; /* maj/min, if VBLK/VCHR */
- struct {
- dev_t xvu_dev; /* device, if VDIR/VREG/VLNK */
- ino_t xvu_ino; /* id, if VDIR/VREG/VLNK */
- } xv_uns;
- } xv_un;
-};
-#define xv_socket xv_un.xvu_socket
-#define xv_fifo xv_un.xvu_fifo
-#define xv_rdev xv_un.xvu_rdev
-#define xv_dev xv_un.xv_uns.xvu_dev
-#define xv_ino xv_un.xv_uns.xvu_ino
-
/* We don't need to lock the knlist */
#define VN_KNLIST_EMPTY(vp) ((vp)->v_pollinfo == NULL || \
KNLIST_EMPTY(&(vp)->v_pollinfo->vpi_selinfo.si_note))

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 10:35 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14714940
Default Alt Text
D39127.diff (6 KB)

Event Timeline