Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*


4412                 vp = NULL;
4413         } else if (pcp->prc_thread == NULL) {
4414                 prunlock(pnp);
4415                 VN_RELE(dp);
4416                 prfreenode(pnp);
4417                 vp = NULL;
4418         } else {
4419                 pnp->pr_next = p->p_plist;
4420                 p->p_plist = vp;
4421                 prunlock(pnp);
4422         }
4423 
4424         return (vp);
4425 }
4426 
4427 #if defined(DEBUG)
4428 
4429 static  uint32_t nprnode;
4430 static  uint32_t nprcommon;
4431 
4432 #define INCREMENT(x)    atomic_add_32(&x, 1);
4433 #define DECREMENT(x)    atomic_add_32(&x, -1);
4434 
4435 #else
4436 
4437 #define INCREMENT(x)
4438 #define DECREMENT(x)
4439 
4440 #endif  /* DEBUG */
4441 
4442 /*
4443  * New /proc vnode required; allocate it and fill in most of the fields.
4444  */
4445 prnode_t *
4446 prgetnode(vnode_t *dp, prnodetype_t type)
4447 {
4448         prnode_t *pnp;
4449         prcommon_t *pcp;
4450         vnode_t *vp;
4451         ulong_t nfiles;
4452 
4453         INCREMENT(nprnode);




4412                 vp = NULL;
4413         } else if (pcp->prc_thread == NULL) {
4414                 prunlock(pnp);
4415                 VN_RELE(dp);
4416                 prfreenode(pnp);
4417                 vp = NULL;
4418         } else {
4419                 pnp->pr_next = p->p_plist;
4420                 p->p_plist = vp;
4421                 prunlock(pnp);
4422         }
4423 
4424         return (vp);
4425 }
4426 
4427 #if defined(DEBUG)
4428 
4429 static  uint32_t nprnode;
4430 static  uint32_t nprcommon;
4431 
4432 #define INCREMENT(x)    atomic_inc_32(&x);
4433 #define DECREMENT(x)    atomic_dec_32(&x);
4434 
4435 #else
4436 
4437 #define INCREMENT(x)
4438 #define DECREMENT(x)
4439 
4440 #endif  /* DEBUG */
4441 
4442 /*
4443  * New /proc vnode required; allocate it and fill in most of the fields.
4444  */
4445 prnode_t *
4446 prgetnode(vnode_t *dp, prnodetype_t type)
4447 {
4448         prnode_t *pnp;
4449         prcommon_t *pcp;
4450         vnode_t *vp;
4451         ulong_t nfiles;
4452 
4453         INCREMENT(nprnode);