MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pwd_set_rootvnode

Function pwd_set_rootvnode

freebsd/kern/kern_descrip.c:4041–4062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4039}
4040
4041void
4042pwd_set_rootvnode(void)
4043{
4044 struct pwddesc *pdp;
4045 struct pwd *oldpwd, *newpwd;
4046
4047 pdp = curproc->p_pd;
4048
4049 newpwd = pwd_alloc();
4050 PWDDESC_XLOCK(pdp);
4051 #pragma GCC diagnostic ignored "-Wcast-qual"
4052 oldpwd = PWDDESC_XLOCKED_LOAD_PWD(pdp);
4053 #pragma GCC diagnostic error "-Wcast-qual"
4054 vrefact(rootvnode);
4055 newpwd->pwd_cdir = rootvnode;
4056 vrefact(rootvnode);
4057 newpwd->pwd_rdir = rootvnode;
4058 pwd_fill(oldpwd, newpwd);
4059 pwd_set(pdp, newpwd);
4060 PWDDESC_XUNLOCK(pdp);
4061 pwd_drop(oldpwd);
4062}
4063
4064/*
4065 * Scan all active processes and prisons to see if any of them have a current

Callers 1

set_rootvnodeFunction · 0.85

Calls 5

pwd_allocFunction · 0.85
pwd_fillFunction · 0.85
pwd_setFunction · 0.85
pwd_dropFunction · 0.85
vrefactFunction · 0.70

Tested by

no test coverage detected