35c35
< * $FreeBSD: head/sys/geom/geom_disk.c 111220 2003-02-21 19:00:48Z phk $
---
> * $FreeBSD: head/sys/geom/geom_disk.c 111668 2003-02-28 10:02:02Z phk $
99d98
< dev_t dev;
109d107
< dev = dp->d_dev;
112c110
< if (dp->d_open != NULL || dp->d_copen != NULL) {
---
> if (dp->d_open != NULL) {
114,117c112
< if (dp->d_open != NULL)
< error = dp->d_open(dp);
< else
< error = dp->d_copen(dev, FREAD|FWRITE, 0, NULL);
---
> error = dp->d_open(dp);
126,127d120
< if (dp->d_maxsize == 0 && dp->d_dev->si_iosize_max != 0)
< dp->d_maxsize = dp->d_dev->si_iosize_max;
134c127
< if (dp->d_close != NULL || dp->d_cclose != NULL) {
---
> if (dp->d_close != NULL) {
136,139c129
< if (dp->d_close != NULL)
< error = dp->d_close(dp);
< else
< error = dp->d_cclose(dev, FREAD|FWRITE, 0, NULL);
---
> error = dp->d_close(dp);
187d176
< dev_t dev;
194d182
< dev = dp->d_dev;
235d222
< bp2->bio_dev = dev;
253c240
< else if ((dp->d_ioctl != NULL || dp->d_cioctl != NULL) &&
---
> else if ((dp->d_ioctl != NULL) &&
257,263c244,245
< if (dp->d_ioctl != NULL) {
< gio->func = (d_ioctl_t *)(dp->d_ioctl);
< gio->dev = dp;
< } else {
< gio->func = dp->d_cioctl;
< gio->dev = dp->d_dev;
< }
---
> gio->dev = dp;
> gio->func = (d_ioctl_t *)(dp->d_ioctl);
269,276c251
< if (!strcmp(bp->bio_attribute, "GEOM::ioctl") &&
< bp->bio_length == sizeof *gio) {
< gio = (struct g_ioctl *)bp->bio_data;
< gio->func = devsw(dp->d_dev)->d_ioctl;
< gio->dev = dp->d_dev;
< error = EDIRIOCTL;
< } else
< error = ENOIOCTL;
---
> error = ENOIOCTL;
335,336c310,311
< dev_t
< disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, void * unused __unused)
---
> void
> disk_create(int unit, struct disk *dp, int flags, void *unused __unused, void * unused2 __unused)
338d312
< dev_t dev;
340d313
< dev = g_malloc(sizeof *dev, M_WAITOK | M_ZERO);
342d314
< dp->d_dev = dev;
344,353d315
< dp->d_devsw = cdevsw;
< dev->si_devsw = cdevsw;
< if (cdevsw != NULL) {
< dp->d_copen = cdevsw->d_open;
< dp->d_cclose = cdevsw->d_close;
< dp->d_cioctl = cdevsw->d_ioctl;
< dp->d_strategy = cdevsw->d_strategy;
< dp->d_dump = cdevsw->d_dump;
< dp->d_name = cdevsw->d_name;
< }
358,361d319
< dev->si_disk = dp;
< dev->si_udev = 0x10002; /* XXX: Needed ? */
< dev->si_name = dev->__si_namebuf;
< sprintf(dev->si_name, "%s%d", dp->d_name, unit);
363d320
< return (dev);
372d328
< g_free(dp->d_dev);
< * $FreeBSD: head/sys/geom/geom_disk.c 111220 2003-02-21 19:00:48Z phk $
---
> * $FreeBSD: head/sys/geom/geom_disk.c 111668 2003-02-28 10:02:02Z phk $
99d98
< dev_t dev;
109d107
< dev = dp->d_dev;
112c110
< if (dp->d_open != NULL || dp->d_copen != NULL) {
---
> if (dp->d_open != NULL) {
114,117c112
< if (dp->d_open != NULL)
< error = dp->d_open(dp);
< else
< error = dp->d_copen(dev, FREAD|FWRITE, 0, NULL);
---
> error = dp->d_open(dp);
126,127d120
< if (dp->d_maxsize == 0 && dp->d_dev->si_iosize_max != 0)
< dp->d_maxsize = dp->d_dev->si_iosize_max;
134c127
< if (dp->d_close != NULL || dp->d_cclose != NULL) {
---
> if (dp->d_close != NULL) {
136,139c129
< if (dp->d_close != NULL)
< error = dp->d_close(dp);
< else
< error = dp->d_cclose(dev, FREAD|FWRITE, 0, NULL);
---
> error = dp->d_close(dp);
187d176
< dev_t dev;
194d182
< dev = dp->d_dev;
235d222
< bp2->bio_dev = dev;
253c240
< else if ((dp->d_ioctl != NULL || dp->d_cioctl != NULL) &&
---
> else if ((dp->d_ioctl != NULL) &&
257,263c244,245
< if (dp->d_ioctl != NULL) {
< gio->func = (d_ioctl_t *)(dp->d_ioctl);
< gio->dev = dp;
< } else {
< gio->func = dp->d_cioctl;
< gio->dev = dp->d_dev;
< }
---
> gio->dev = dp;
> gio->func = (d_ioctl_t *)(dp->d_ioctl);
269,276c251
< if (!strcmp(bp->bio_attribute, "GEOM::ioctl") &&
< bp->bio_length == sizeof *gio) {
< gio = (struct g_ioctl *)bp->bio_data;
< gio->func = devsw(dp->d_dev)->d_ioctl;
< gio->dev = dp->d_dev;
< error = EDIRIOCTL;
< } else
< error = ENOIOCTL;
---
> error = ENOIOCTL;
335,336c310,311
< dev_t
< disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, void * unused __unused)
---
> void
> disk_create(int unit, struct disk *dp, int flags, void *unused __unused, void * unused2 __unused)
338d312
< dev_t dev;
340d313
< dev = g_malloc(sizeof *dev, M_WAITOK | M_ZERO);
342d314
< dp->d_dev = dev;
344,353d315
< dp->d_devsw = cdevsw;
< dev->si_devsw = cdevsw;
< if (cdevsw != NULL) {
< dp->d_copen = cdevsw->d_open;
< dp->d_cclose = cdevsw->d_close;
< dp->d_cioctl = cdevsw->d_ioctl;
< dp->d_strategy = cdevsw->d_strategy;
< dp->d_dump = cdevsw->d_dump;
< dp->d_name = cdevsw->d_name;
< }
358,361d319
< dev->si_disk = dp;
< dev->si_udev = 0x10002; /* XXX: Needed ? */
< dev->si_name = dev->__si_namebuf;
< sprintf(dev->si_name, "%s%d", dp->d_name, unit);
363d320
< return (dev);
372d328
< g_free(dp->d_dev);