Deleted Added
full compact
kern_physio.c (40648) kern_physio.c (42957)
1/*
2 * Copyright (c) 1994 John S. Dyson
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
9 * notice immediately at the beginning of the file, without modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Absolutely no warranty of function or purpose is made by the author
15 * John S. Dyson.
16 * 4. Modifications may be freely made to this file if the above conditions
17 * are met.
18 *
1/*
2 * Copyright (c) 1994 John S. Dyson
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
9 * notice immediately at the beginning of the file, without modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Absolutely no warranty of function or purpose is made by the author
15 * John S. Dyson.
16 * 4. Modifications may be freely made to this file if the above conditions
17 * are met.
18 *
19 * $Id: kern_physio.c,v 1.28 1998/08/19 10:50:32 sos Exp $
19 * $Id: kern_physio.c,v 1.29 1998/10/25 17:44:51 phk Exp $
20 */
21
22#include <sys/param.h>
23#include <sys/systm.h>
24#include <sys/buf.h>
25#include <sys/conf.h>
26#include <sys/proc.h>
27#include <sys/uio.h>

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

142 error = bp->b_error;
143 goto doerror;
144 }
145 }
146 }
147
148
149doerror:
20 */
21
22#include <sys/param.h>
23#include <sys/systm.h>
24#include <sys/buf.h>
25#include <sys/conf.h>
26#include <sys/proc.h>
27#include <sys/uio.h>

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

142 error = bp->b_error;
143 goto doerror;
144 }
145 }
146 }
147
148
149doerror:
150 relpbuf(bpa);
150 relpbuf(bpa, NULL);
151 if (!bp_alloc) {
152 bp->b_flags &= ~(B_BUSY|B_PHYS);
153 if( bp->b_flags & B_WANTED) {
154 bp->b_flags &= ~B_WANTED;
155 wakeup((caddr_t)bp);
156 }
157 }
158/*

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

192struct buf *
193phygetvpbuf(dev_t dev, int resid)
194{
195 struct cdevsw *bdsw;
196 int maxio;
197
198 bdsw = cdevsw[major(dev)];
199 if ((bdsw == NULL) || (bdsw->d_bmaj == -1))
151 if (!bp_alloc) {
152 bp->b_flags &= ~(B_BUSY|B_PHYS);
153 if( bp->b_flags & B_WANTED) {
154 bp->b_flags &= ~B_WANTED;
155 wakeup((caddr_t)bp);
156 }
157 }
158/*

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

192struct buf *
193phygetvpbuf(dev_t dev, int resid)
194{
195 struct cdevsw *bdsw;
196 int maxio;
197
198 bdsw = cdevsw[major(dev)];
199 if ((bdsw == NULL) || (bdsw->d_bmaj == -1))
200 return getpbuf();
200 return getpbuf(NULL);
201
202 maxio = bdsw->d_maxio;
203 if (resid > maxio)
204 resid = maxio;
205
201
202 maxio = bdsw->d_maxio;
203 if (resid > maxio)
204 resid = maxio;
205
206 return getpbuf();
206 return getpbuf(NULL);
207}
208
209static void
210physwakeup(bp)
211 struct buf *bp;
212{
213 wakeup((caddr_t) bp);
214 bp->b_flags &= ~B_CALL;
215}
207}
208
209static void
210physwakeup(bp)
211 struct buf *bp;
212{
213 wakeup((caddr_t) bp);
214 bp->b_flags &= ~B_CALL;
215}