Deleted Added
sdiff udiff text old ( 119652 ) new ( 119660 )
full compact
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

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

29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/geom/geom_disk.c 119652 2003-09-01 12:03:13Z phk $");
38
39#include "opt_geom.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/kernel.h>
44#include <sys/sysctl.h>
45#include <sys/bio.h>

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

189 if (bp2->bio_children == bp2->bio_inbed) {
190 bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed;
191 devstat_end_transaction_bio(dp->d_devstat, bp2);
192 g_io_deliver(bp2, bp2->bio_error);
193 }
194 mtx_unlock(&g_disk_done_mtx);
195}
196
197static void
198g_disk_start(struct bio *bp)
199{
200 struct bio *bp2, *bp3;
201 struct disk *dp;
202 struct g_ioctl *gio;
203 int error;
204 off_t off;
205
206 dp = bp->bio_to->geom->softc;
207 if (dp == NULL)
208 g_io_deliver(bp, ENXIO);
209 error = EJUSTRETURN;
210 switch(bp->bio_cmd) {

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

259 if (g_handleattr_int(bp, "GEOM::fwsectors", dp->d_fwsectors))
260 break;
261 else if (g_handleattr_int(bp, "GEOM::fwheads", dp->d_fwheads))
262 break;
263 else if (g_handleattr_off_t(bp, "GEOM::frontstuff", 0))
264 break;
265 else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump"))
266 g_disk_kerneldump(bp, dp);
267 else if ((g_debugflags & G_F_DISKIOCTL) &&
268 (dp->d_ioctl != NULL) &&
269 !strcmp(bp->bio_attribute, "GEOM::ioctl") &&
270 bp->bio_length == sizeof *gio) {
271 gio = (struct g_ioctl *)bp->bio_data;
272 gio->dev = dp;
273 gio->func = (d_ioctl_t *)(dp->d_ioctl);
274 error = EDIRIOCTL;
275 } else
276 error = ENOIOCTL;
277 break;
278 default:
279 error = EOPNOTSUPP;
280 break;
281 }
282 if (error != EJUSTRETURN)
283 g_io_deliver(bp, error);

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

312
313 if (flag == EV_CANCEL)
314 return;
315 g_topology_assert();
316 dp = arg;
317 gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit);
318 gp->start = g_disk_start;
319 gp->access = g_disk_access;
320 gp->softc = dp;
321 gp->dumpconf = g_disk_dumpconf;
322 pp = g_new_providerf(gp, "%s", gp->name);
323 pp->mediasize = dp->d_mediasize;
324 pp->sectorsize = dp->d_sectorsize;
325 if (dp->d_flags & DISKFLAG_CANDELETE)
326 pp->flags |= G_PF_CANDELETE;
327 pp->stripeoffset = dp->d_stripeoffset;

--- 90 unchanged lines hidden ---