diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2015-07-11 16:22:48 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2015-07-11 16:22:48 +0000 |
commit | 8a08cec1660617204ccb44ee29cf3be4d1e63d33 (patch) | |
tree | f949fd85e6011817842d92d50f444ca5039ab9c7 /sys/kern/subr_firmware.c | |
parent | f0725a8e1e81a8f35311db80e00545f4bb6c2b9c (diff) | |
download | src-8a08cec1660617204ccb44ee29cf3be4d1e63d33.tar.gz src-8a08cec1660617204ccb44ee29cf3be4d1e63d33.zip |
Create a dedicated function for ensuring that cdir and rdir are populated.
Previously several places were doing it on its own, partially
incorrectly (e.g. without the filedesc locked) or even actively harmful
by populating jdir or assigning rootvnode without vrefing it.
Reviewed by: kib
Notes
Notes:
svn path=/head/; revision=285391
Diffstat (limited to 'sys/kern/subr_firmware.c')
-rw-r--r-- | sys/kern/subr_firmware.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sys/kern/subr_firmware.c b/sys/kern/subr_firmware.c index 20ab76e282be..172d7198dc66 100644 --- a/sys/kern/subr_firmware.c +++ b/sys/kern/subr_firmware.c @@ -383,19 +383,8 @@ firmware_put(const struct firmware *p, int flags) static void set_rootvnode(void *arg, int npending) { - struct thread *td = curthread; - struct proc *p = td->td_proc; - FILEDESC_XLOCK(p->p_fd); - if (p->p_fd->fd_cdir == NULL) { - p->p_fd->fd_cdir = rootvnode; - VREF(rootvnode); - } - if (p->p_fd->fd_rdir == NULL) { - p->p_fd->fd_rdir = rootvnode; - VREF(rootvnode); - } - FILEDESC_XUNLOCK(p->p_fd); + pwd_ensure_dirs(); free(arg, M_TEMP); } |