| 2234 | } |
| 2235 | |
| 2236 | static void |
| 2237 | pddrop(struct pwddesc *pdp) |
| 2238 | { |
| 2239 | struct pwd *pwd; |
| 2240 | |
| 2241 | if (refcount_release_if_not_last(&pdp->pd_refcount)) |
| 2242 | return; |
| 2243 | |
| 2244 | PWDDESC_XLOCK(pdp); |
| 2245 | if (refcount_release(&pdp->pd_refcount) == 0) { |
| 2246 | PWDDESC_XUNLOCK(pdp); |
| 2247 | return; |
| 2248 | } |
| 2249 | #pragma GCC diagnostic ignored "-Wcast-qual" |
| 2250 | pwd = PWDDESC_XLOCKED_LOAD_PWD(pdp); |
| 2251 | #pragma GCC diagnostic error "-Wcast-qual" |
| 2252 | pwd_set(pdp, NULL); |
| 2253 | PWDDESC_XUNLOCK(pdp); |
| 2254 | pwd_drop(pwd); |
| 2255 | |
| 2256 | PWDDESC_LOCK_DESTROY(pdp); |
| 2257 | free(pdp, M_PWDDESC); |
| 2258 | } |
| 2259 | |
| 2260 | /* |
| 2261 | * Share a filedesc structure. |
no test coverage detected