Add a proc lock assertion and move another assertion up to the top of the

function.
This commit is contained in:
John Baldwin 2003-04-17 22:12:12 +00:00
parent 4cac73c759
commit c110b8e65e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113617

View file

@ -93,6 +93,9 @@ procfs_docurproc(PFS_FILL_ARGS)
int
procfs_attr(PFS_ATTR_ARGS)
{
PROC_LOCK_ASSERT(p, MA_OWNED);
/* XXX inefficient, split into separate functions */
if (p->p_flag & P_SUGID)
vap->va_mode = 0;
@ -106,8 +109,6 @@ procfs_attr(PFS_ATTR_ARGS)
strcmp(pn->pn_name, "fpregs") == 0)
vap->va_mode = 0600;
/* p is locked by caller */
PROC_LOCK_ASSERT(p, MA_OWNED);
vap->va_uid = p->p_ucred->cr_uid;
vap->va_gid = p->p_ucred->cr_gid;
@ -121,6 +122,7 @@ procfs_attr(PFS_ATTR_ARGS)
int
procfs_notsystem(PFS_VIS_ARGS)
{
PROC_LOCK_ASSERT(p, MA_OWNED);
return ((p->p_flag & P_SYSTEM) == 0);
}