| 3844 | } |
| 3845 | |
| 3846 | struct pwd * |
| 3847 | pwd_hold(struct thread *td) |
| 3848 | { |
| 3849 | struct pwddesc *pdp; |
| 3850 | struct pwd *pwd; |
| 3851 | |
| 3852 | pdp = td->td_proc->p_pd; |
| 3853 | |
| 3854 | vfs_smr_enter(); |
| 3855 | pwd = vfs_smr_entered_load(&pdp->pd_pwd); |
| 3856 | if (pwd_hold_smr(pwd)) { |
| 3857 | vfs_smr_exit(); |
| 3858 | return (pwd); |
| 3859 | } |
| 3860 | vfs_smr_exit(); |
| 3861 | PWDDESC_XLOCK(pdp); |
| 3862 | pwd = pwd_hold_pwddesc(pdp); |
| 3863 | MPASS(pwd != NULL); |
| 3864 | PWDDESC_XUNLOCK(pdp); |
| 3865 | return (pwd); |
| 3866 | } |
| 3867 | |
| 3868 | static struct pwd * |
| 3869 | pwd_alloc(void) |
no test coverage detected