-/* $OpenBSD: vnconfig.c,v 1.12 2022/10/04 06:52:52 kn Exp $ */
+/* $OpenBSD: vnconfig.c,v 1.13 2023/05/14 18:34:02 krw Exp $ */
/*
* Copyright (c) 1993 University of Utah.
* Copyright (c) 1990, 1993
memset(&vndio, 0, sizeof vndio);
vndio.vnd_file = file;
+ vndio.vnd_type = (dp && dp->d_type) ? dp->d_type : DTYPE_VND;
vndio.vnd_secsize = (dp && dp->d_secsize) ? dp->d_secsize : DEV_BSIZE;
vndio.vnd_nsectors = (dp && dp->d_nsectors) ? dp->d_nsectors : 100;
vndio.vnd_ntracks = (dp && dp->d_ntracks) ? dp->d_ntracks : 1;
-/* $OpenBSD: vnd.c,v 1.180 2023/03/08 04:43:08 guenther Exp $ */
+/* $OpenBSD: vnd.c,v 1.181 2023/05/14 18:34:02 krw Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
char sc_file[VNDNLEN]; /* file we're covering */
int sc_flags; /* flags */
+ uint16_t sc_type; /* d_type we are emulating */
size_t sc_size; /* size of vnd in sectors */
size_t sc_secsize; /* sector size in bytes */
size_t sc_nsectors; /* # of sectors per track */
lp->d_ncylinders = sc->sc_size / lp->d_secpercyl;
strncpy(lp->d_typename, "vnd device", sizeof(lp->d_typename));
- lp->d_type = DTYPE_VND;
+ lp->d_type = sc->sc_type;
strncpy(lp->d_packname, "fictitious", sizeof(lp->d_packname));
DL_SETDSIZE(lp, sc->sc_size);
lp->d_version = 1;
}
/* Set geometry for device. */
+ sc->sc_type = vio->vnd_type;
sc->sc_secsize = vio->vnd_secsize;
sc->sc_ntracks = vio->vnd_ntracks;
sc->sc_nsectors = vio->vnd_nsectors;
-/* $OpenBSD: vndioctl.h,v 1.11 2019/11/18 22:32:45 jca Exp $ */
+/* $OpenBSD: vndioctl.h,v 1.12 2023/05/14 18:34:02 krw Exp $ */
/* $NetBSD: vndioctl.h,v 1.5 1995/01/25 04:46:30 cgd Exp $ */
/*
* Ioctl definitions for file (vnode) disk pseudo-device.
*/
struct vnd_ioctl {
- char *vnd_file; /* pathname of file to mount */
- size_t vnd_secsize; /* sector size in bytes */
- size_t vnd_nsectors; /* number of sectors in a track */
- size_t vnd_ntracks; /* number of tracks per cylinder (i.e. heads) */
- off_t vnd_size; /* (returned) size of disk */
- u_char *vnd_key;
- int vnd_keylen;
+ char *vnd_file; /* pathname of file to mount */
+ size_t vnd_secsize; /* sector size in bytes */
+ size_t vnd_nsectors; /* number of sectors in a track */
+ size_t vnd_ntracks; /* number of tracks per cylinder */
+ off_t vnd_size; /* (returned) size of disk */
+ u_char *vnd_key;
+ int vnd_keylen;
+ uint16_t vnd_type; /* DTYPE being emulated */
};
/*