fd: add pwd_hold_proc
This commit is contained in:
parent
41e9466943
commit
85c855d31b
@ -3791,6 +3791,26 @@ pwd_hold(struct thread *td)
|
|||||||
return (pwd);
|
return (pwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct pwd *
|
||||||
|
pwd_hold_proc(struct proc *p)
|
||||||
|
{
|
||||||
|
struct pwddesc *pdp;
|
||||||
|
struct pwd *pwd;
|
||||||
|
|
||||||
|
PROC_ASSERT_HELD(p);
|
||||||
|
PROC_LOCK(p);
|
||||||
|
pdp = pdhold(p);
|
||||||
|
MPASS(pdp != NULL);
|
||||||
|
PROC_UNLOCK(p);
|
||||||
|
|
||||||
|
PWDDESC_XLOCK(pdp);
|
||||||
|
pwd = pwd_hold_pwddesc(pdp);
|
||||||
|
MPASS(pwd != NULL);
|
||||||
|
PWDDESC_XUNLOCK(pdp);
|
||||||
|
pddrop(pdp);
|
||||||
|
return (pwd);
|
||||||
|
}
|
||||||
|
|
||||||
static struct pwd *
|
static struct pwd *
|
||||||
pwd_alloc(void)
|
pwd_alloc(void)
|
||||||
{
|
{
|
||||||
|
@ -341,6 +341,7 @@ void pwd_set_rootvnode(void);
|
|||||||
|
|
||||||
struct pwd *pwd_hold_pwddesc(struct pwddesc *pdp);
|
struct pwd *pwd_hold_pwddesc(struct pwddesc *pdp);
|
||||||
bool pwd_hold_smr(struct pwd *pwd);
|
bool pwd_hold_smr(struct pwd *pwd);
|
||||||
|
struct pwd *pwd_hold_proc(struct proc *p);
|
||||||
struct pwd *pwd_hold(struct thread *td);
|
struct pwd *pwd_hold(struct thread *td);
|
||||||
void pwd_drop(struct pwd *pwd);
|
void pwd_drop(struct pwd *pwd);
|
||||||
static inline void
|
static inline void
|
||||||
|
Loading…
Reference in New Issue
Block a user