Date: Tue, 19 Mar 2002 07:05:03 -0800 (PST) From: Poul-Henning Kamp <phk@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 7960 for review Message-ID: <200203191505.g2JF53O21650@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=7960 Change 7960 by phk@phk_flat on 2002/03/19 07:04:26 Get the new ioctls over. Affected files ... ... //depot/projects/sparc64/sys/geom/geom_dev.c#3 integrate ... //depot/projects/sparc64/sys/sys/disklabel.h#10 integrate Differences ... ==== //depot/projects/sparc64/sys/geom/geom_dev.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/geom_dev.c,v 1.4 2002/03/17 07:42:54 phk Exp $ + * $FreeBSD: src/sys/geom/geom_dev.c,v 1.5 2002/03/19 13:54:15 phk Exp $ */ #include <sys/param.h> @@ -248,17 +248,37 @@ error = 0; DROP_GIANT(); - gio = g_malloc(sizeof *gio, M_WAITOK); - gio->cmd = cmd; - gio->data = data; - gio->fflag = fflag; - gio->td = td; - i = sizeof *gio; - if (cmd & IOC_IN) - error = g_io_setattr("GEOM::ioctl", cp, i, gio, td); - else - error = g_io_getattr("GEOM::ioctl", cp, &i, gio, td); - g_free(gio); + i = IOCPARM_LEN(cmd); + switch (cmd) { + case DIOCGSECTORSIZE: + error = g_io_getattr("GEOM::sectorsize", cp, &i, data, td); + break; + case DIOCGMEDIASIZE: + error = g_io_getattr("GEOM::mediasize", cp, &i, data, td); + break; + case DIOCGFWSECTORS: + error = g_io_getattr("GEOM::fwsectors", cp, &i, data, td); + break; + case DIOCGFWHEADS: + error = g_io_getattr("GEOM::fwheads", cp, &i, data, td); + break; + case DIOCGFWCYLINDERS: + error = g_io_getattr("GEOM::fwcylinders", cp, &i, data, td); + break; + default: + gio = g_malloc(sizeof *gio, M_WAITOK); + gio->cmd = cmd; + gio->data = data; + gio->fflag = fflag; + gio->td = td; + i = sizeof *gio; + if (cmd & IOC_IN) + error = g_io_setattr("GEOM::ioctl", cp, i, gio, td); + else + error = g_io_getattr("GEOM::ioctl", cp, &i, gio, td); + g_free(gio); + break; + } if (error != 0 && cmd == DIOCGDVIRGIN) { g_topology_lock(); ==== //depot/projects/sparc64/sys/sys/disklabel.h#10 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 - * $FreeBSD: src/sys/sys/disklabel.h,v 1.67 2002/03/13 03:17:29 jake Exp $ + * $FreeBSD: src/sys/sys/disklabel.h,v 1.68 2002/03/19 13:54:13 phk Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -418,6 +418,12 @@ #define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */ +#define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */ +#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ +#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ +#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ +#define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */ + #ifdef _KERNEL /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203191505.g2JF53O21650>