subr_firmware.c (237546) | subr_firmware.c (285391) |
---|---|
1/*- 2 * Copyright (c) 2005-2008, Sam Leffler <sam@errno.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005-2008, Sam Leffler <sam@errno.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/subr_firmware.c 237546 2012-06-25 05:41:16Z kevlo $"); | 28__FBSDID("$FreeBSD: head/sys/kern/subr_firmware.c 285391 2015-07-11 16:22:48Z mjg $"); |
29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/malloc.h> 33#include <sys/queue.h> 34#include <sys/taskqueue.h> 35#include <sys/systm.h> 36#include <sys/lock.h> --- 341 unchanged lines hidden (view full) --- 378} 379 380/* 381 * Setup directory state for the firmware_tq thread so we can do i/o. 382 */ 383static void 384set_rootvnode(void *arg, int npending) 385{ | 29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/malloc.h> 33#include <sys/queue.h> 34#include <sys/taskqueue.h> 35#include <sys/systm.h> 36#include <sys/lock.h> --- 341 unchanged lines hidden (view full) --- 378} 379 380/* 381 * Setup directory state for the firmware_tq thread so we can do i/o. 382 */ 383static void 384set_rootvnode(void *arg, int npending) 385{ |
386 struct thread *td = curthread; 387 struct proc *p = td->td_proc; | |
388 | 386 |
389 FILEDESC_XLOCK(p->p_fd); 390 if (p->p_fd->fd_cdir == NULL) { 391 p->p_fd->fd_cdir = rootvnode; 392 VREF(rootvnode); 393 } 394 if (p->p_fd->fd_rdir == NULL) { 395 p->p_fd->fd_rdir = rootvnode; 396 VREF(rootvnode); 397 } 398 FILEDESC_XUNLOCK(p->p_fd); | 387 pwd_ensure_dirs(); |
399 400 free(arg, M_TEMP); 401} 402 403/* 404 * Event handler called on mounting of /; bounce a task 405 * into the task queue thread to setup it's directories. 406 */ --- 131 unchanged lines hidden --- | 388 389 free(arg, M_TEMP); 390} 391 392/* 393 * Event handler called on mounting of /; bounce a task 394 * into the task queue thread to setup it's directories. 395 */ --- 131 unchanged lines hidden --- |