MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sysctl_vfs_ctl

Function sysctl_vfs_ctl

freebsd/kern/vfs_subr.c:6080–6105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6078}
6079
6080static int
6081sysctl_vfs_ctl(SYSCTL_HANDLER_ARGS)
6082{
6083 struct vfsidctl vc;
6084 int error;
6085 struct mount *mp;
6086
6087 error = SYSCTL_IN(req, &vc, sizeof(vc));
6088 if (error)
6089 return (error);
6090 if (vc.vc_vers != VFS_CTL_VERS1)
6091 return (EINVAL);
6092 mp = vfs_getvfs(&vc.vc_fsid);
6093 if (mp == NULL)
6094 return (ENOENT);
6095 /* ensure that a specific sysctl goes to the right filesystem. */
6096 if (strcmp(vc.vc_fstypename, "*") != 0 &&
6097 strcmp(vc.vc_fstypename, mp->mnt_vfc->vfc_name) != 0) {
6098 vfs_rel(mp);
6099 return (EINVAL);
6100 }
6101 VCTLTOREQ(&vc, req);
6102 error = VFS_SYSCTL(mp, vc.vc_op, req);
6103 vfs_rel(mp);
6104 return (error);
6105}
6106
6107SYSCTL_PROC(_vfs, OID_AUTO, ctl, CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | CTLFLAG_WR,
6108 NULL, 0, sysctl_vfs_ctl, "",

Callers

nothing calls this directly

Calls 3

vfs_getvfsFunction · 0.85
strcmpFunction · 0.85
vfs_relFunction · 0.85

Tested by

no test coverage detected