Deleted Added
full compact
34c34
< __FBSDID("$FreeBSD: head/sys/geom/geom_pc98.c 116196 2003-06-11 06:49:16Z obrien $");
---
> __FBSDID("$FreeBSD: head/sys/geom/geom_pc98.c 119660 2003-09-01 20:45:32Z phk $");
137,138c137,138
< static void
< g_pc98_ioctl(void *arg, int flag)
---
> static int
> g_pc98_ioctl(struct g_provider *pp, u_long cmd, void *data, struct thread *td)
140d139
< struct bio *bp;
142d140
< struct g_slicer *gsp;
144c142
< struct g_ioctl *gio;
---
> struct g_slicer *gsp;
146d143
< u_char *sec;
149,154c146
< bp = arg;
< if (flag == EV_CANCEL) {
< g_io_deliver(bp, ENXIO);
< return;
< }
< gp = bp->bio_to->geom;
---
> gp = pp->geom;
157d148
< gio = (struct g_ioctl *)bp->bio_data;
159,165c150,160
< /* The disklabel to set is the ioctl argument. */
< sec = gio->data;
<
< error = g_pc98_modify(gp, ms, sec);
< if (error) {
< g_io_deliver(bp, error);
< return;
---
> switch(cmd) {
> case DIOCSPC98: {
> DROP_GIANT();
> g_topology_lock();
> /* Validate and modify our slicer instance to match. */
> error = g_pc98_modify(gp, ms, data);
> cp = LIST_FIRST(&gp->consumer);
> error = g_write_data(cp, 0, data, 8192);
> g_topology_unlock();
> PICKUP_GIANT();
> return(error);
167,169c162,164
< cp = LIST_FIRST(&gp->consumer);
< error = g_write_data(cp, 0, sec, 8192);
< g_io_deliver(bp, error);
---
> default:
> return (ENOIOCTL);
> }
179,180c174
< struct g_ioctl *gio;
< int idx, error;
---
> int idx;
195,220c189
< /* We only handle ioctl(2) requests of the right format. */
< if (strcmp(bp->bio_attribute, "GEOM::ioctl"))
< return (0);
< else if (bp->bio_length != sizeof(*gio))
< return (0);
< /* Get hold of the ioctl parameters. */
< gio = (struct g_ioctl *)bp->bio_data;
<
< switch (gio->cmd) {
< case DIOCSPC98:
< /*
< * These we cannot do without the topology lock and some
< * some I/O requests. Ask the event-handler to schedule
< * us in a less restricted environment.
< */
< error = g_post_event(g_pc98_ioctl, bp, M_NOWAIT, gp, NULL);
< if (error)
< g_io_deliver(bp, error);
< /*
< * We must return non-zero to indicate that we will deal
< * with this bio, even though we have not done so yet.
< */
< return (1);
< default:
< return (0);
< }
---
> return (0);
272a242
> gp->ioctl = g_pc98_ioctl;