1/*
2 * Copyright (c) 1997 John S. Dyson. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. John S. Dyson's name may not be used to endorse or promote products
10 * derived from this software without specific prior written permission.
11 *
12 * DISCLAIMER: This code isn't warranted to do anything useful. Anything
13 * bad that happens because of using this software isn't the responsibility
14 * of the author. This software is distributed AS-IS.
15 *
16 * $FreeBSD: head/sys/kern/vfs_aio.c 90576 2002-02-12 17:40:41Z alc $
17 */
18
19/*
20 * This file contains support for the POSIX 1003.1B AIO/LIO facility.
21 */
22
23#include <sys/param.h>
24#include <sys/systm.h>
25#include <sys/bio.h>
26#include <sys/buf.h>
27#include <sys/sysproto.h>
28#include <sys/filedesc.h>
29#include <sys/kernel.h>
30#include <sys/kthread.h>
31#include <sys/fcntl.h>
32#include <sys/file.h>
--- 703 unchanged lines hidden (view full) ---
736 struct aio_liojob *lj;
737 struct aiocb *cb;
738 struct aiocblist *aiocbe;
739 struct aiothreadlist *aiop;
740 struct kaioinfo *ki;
741 struct proc *curcp, *mycp, *userp;
742 struct vmspace *myvm, *tmpvm;
743 struct thread *td = curthread;
744
745 mtx_lock(&Giant);
746 /*
747 * Local copies of curproc (cp) and vmspace (myvm)
748 */
749 mycp = td->td_proc;
750 myvm = mycp->p_vmspace;
751
--- 24 unchanged lines hidden (view full) ---
776 /*
777 * Get rid of our current filedescriptors. AIOD's don't need any
778 * filedescriptors, except as temporarily inherited from the client.
779 */
780 fdfree(td);
781 mycp->p_fd = NULL;
782
783 /* The daemon resides in its own pgrp. */
784 enterpgrp(mycp, mycp->p_pid, 1);
785
786 /* Mark special process type. */
787 mycp->p_flag |= P_SYSTEM;
788
789 /*
790 * Wakeup parent process. (Parent sleeps to keep from blasting away
791 * and creating too many daemons.)
792 */
793 wakeup(mycp);
--- 1526 unchanged lines hidden ---
2 * Copyright (c) 1997 John S. Dyson. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. John S. Dyson's name may not be used to endorse or promote products
10 * derived from this software without specific prior written permission.
11 *
12 * DISCLAIMER: This code isn't warranted to do anything useful. Anything
13 * bad that happens because of using this software isn't the responsibility
14 * of the author. This software is distributed AS-IS.
15 *
16 * $FreeBSD: head/sys/kern/vfs_aio.c 90576 2002-02-12 17:40:41Z alc $
17 */
18
19/*
20 * This file contains support for the POSIX 1003.1B AIO/LIO facility.
21 */
22
23#include <sys/param.h>
24#include <sys/systm.h>
25#include <sys/bio.h>
26#include <sys/buf.h>
27#include <sys/sysproto.h>
28#include <sys/filedesc.h>
29#include <sys/kernel.h>
30#include <sys/kthread.h>
31#include <sys/fcntl.h>
32#include <sys/file.h>
--- 703 unchanged lines hidden (view full) ---
736 struct aio_liojob *lj;
737 struct aiocb *cb;
738 struct aiocblist *aiocbe;
739 struct aiothreadlist *aiop;
740 struct kaioinfo *ki;
741 struct proc *curcp, *mycp, *userp;
742 struct vmspace *myvm, *tmpvm;
743 struct thread *td = curthread;
744
745 mtx_lock(&Giant);
746 /*
747 * Local copies of curproc (cp) and vmspace (myvm)
748 */
749 mycp = td->td_proc;
750 myvm = mycp->p_vmspace;
751
--- 24 unchanged lines hidden (view full) ---
776 /*
777 * Get rid of our current filedescriptors. AIOD's don't need any
778 * filedescriptors, except as temporarily inherited from the client.
779 */
780 fdfree(td);
781 mycp->p_fd = NULL;
782
783 /* The daemon resides in its own pgrp. */
784 enterpgrp(mycp, mycp->p_pid, 1);
785
786 /* Mark special process type. */
787 mycp->p_flag |= P_SYSTEM;
788
789 /*
790 * Wakeup parent process. (Parent sleeps to keep from blasting away
791 * and creating too many daemons.)
792 */
793 wakeup(mycp);
--- 1526 unchanged lines hidden ---