svn commit: r278760 - head/sys/kern
John Baldwin
jhb at freebsd.org
Mon Feb 16 14:45:05 UTC 2015
On Saturday, February 14, 2015 07:21:10 PM Mateusz Guzik wrote:
> On Sat, Feb 14, 2015 at 05:02:51PM +0000, John Baldwin wrote:
> > +SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created,
> > + 0, "Number of vnodes created by getnewvnode");
> > +
>
> [..]
>
> > +static u_long recycles_count;
> > +SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0,
> > + "Number of vnodes recycled to avoid exceding kern.maxvnodes");
> > +
>
> CTLFLAG_MPSAFE?
#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_long, "LU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG) && \
sizeof(unsigned long) == sizeof(*(ptr)))
All the trivial sysctls already include CTLFLAG_MPSAFE so that I didn't have
to go spray that flag all over the tree. Only SYSCTL_PROC nodes need to be
explicitly tagged.
--
John Baldwin
More information about the svn-src-all
mailing list