Deleted Added
full compact
nfs_nfsiod.c (104354) nfs_nfsiod.c (111748)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 23 unchanged lines hidden (view full) ---

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
37 */
38
39#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 23 unchanged lines hidden (view full) ---

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
37 */
38
39#include <sys/cdefs.h>
40__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_nfsiod.c 104354 2002-10-02 07:44:29Z scottl $");
40__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_nfsiod.c 111748 2003-03-02 16:54:40Z des $");
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/sysproto.h>
45#include <sys/kernel.h>
46#include <sys/sysctl.h>
47#include <sys/file.h>
48#include <sys/filedesc.h>

--- 90 unchanged lines hidden (view full) ---

139 * If there are some asleep nfsiods that should
140 * exit, wakeup() them so that they check nfs_iodmax
141 * and exit. Those who are active will exit as
142 * soon as they finish I/O.
143 */
144 iod = nfs_numasync - 1;
145 for (i = 0; i < nfs_numasync - nfs_iodmax; i++) {
146 if (nfs_iodwant[iod])
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/sysproto.h>
45#include <sys/kernel.h>
46#include <sys/sysctl.h>
47#include <sys/file.h>
48#include <sys/filedesc.h>

--- 90 unchanged lines hidden (view full) ---

139 * If there are some asleep nfsiods that should
140 * exit, wakeup() them so that they check nfs_iodmax
141 * and exit. Those who are active will exit as
142 * soon as they finish I/O.
143 */
144 iod = nfs_numasync - 1;
145 for (i = 0; i < nfs_numasync - nfs_iodmax; i++) {
146 if (nfs_iodwant[iod])
147 wakeup((caddr_t)&nfs_iodwant[iod]);
147 wakeup(&nfs_iodwant[iod]);
148 iod--;
149 }
150 return (0);
151}
152SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0,
153 sizeof (nfs_iodmax), sysctl_iodmax, "IU", "");
154
155int

--- 83 unchanged lines hidden (view full) ---

239 if (nmp)
240 nmp->nm_bufqiods--;
241 nfs_iodwant[myiod] = curthread->td_proc;
242 nfs_iodmount[myiod] = NULL;
243 /*
244 * Always keep at least nfs_iodmin kthreads.
245 */
246 timo = (myiod < nfs_iodmin) ? 0 : nfs_iodmaxidle * hz;
148 iod--;
149 }
150 return (0);
151}
152SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0,
153 sizeof (nfs_iodmax), sysctl_iodmax, "IU", "");
154
155int

--- 83 unchanged lines hidden (view full) ---

239 if (nmp)
240 nmp->nm_bufqiods--;
241 nfs_iodwant[myiod] = curthread->td_proc;
242 nfs_iodmount[myiod] = NULL;
243 /*
244 * Always keep at least nfs_iodmin kthreads.
245 */
246 timo = (myiod < nfs_iodmin) ? 0 : nfs_iodmaxidle * hz;
247 error = tsleep((caddr_t)&nfs_iodwant[myiod], PWAIT | PCATCH,
247 error = tsleep(&nfs_iodwant[myiod], PWAIT | PCATCH,
248 "nfsidl", timo);
249 }
250 if (error)
251 break;
252 while ((bp = TAILQ_FIRST(&nmp->nm_bufq)) != NULL) {
253 /* Take one off the front of the list */
254 TAILQ_REMOVE(&nmp->nm_bufq, bp, b_freelist);
255 nmp->nm_bufqlen--;

--- 34 unchanged lines hidden ---
248 "nfsidl", timo);
249 }
250 if (error)
251 break;
252 while ((bp = TAILQ_FIRST(&nmp->nm_bufq)) != NULL) {
253 /* Take one off the front of the list */
254 TAILQ_REMOVE(&nmp->nm_bufq, bp, b_freelist);
255 nmp->nm_bufqlen--;

--- 34 unchanged lines hidden ---