* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* @(#)dev.c 7.4 (Berkeley) 6/29/88
* NB: the value "io->i_ino.i_dev", used to offset the devsw[] array
* in the routines below, is munged by the vaxstand Makefile to work
cc
= (*devsw
[io
->i_ino
.i_dev
].dv_strategy
)(io
, READ
);
io
->i_flgs
&= ~F_TYPEMASK
;
cc
= (*devsw
[io
->i_ino
.i_dev
].dv_strategy
)(io
, WRITE
);
io
->i_flgs
&= ~F_TYPEMASK
;
if (!(ret
= (*devsw
[io
->i_ino
.i_dev
].dv_open
)(io
)))
printf("%s(%d,%d,%d,%d): ", devsw
[io
->i_ino
.i_dev
].dv_name
,
io
->i_adapt
, io
->i_ctlr
, io
->i_unit
, io
->i_part
);
break; /* already reported */
printf("bad adaptor number\n");
printf("bad controller number\n");
printf("bad drive number\n");
printf("bad partition\n");
printf("can't read disk label\n");
printf("bad device specification\n");
printf("unknown open error\n");
(*devsw
[io
->i_ino
.i_dev
].dv_close
)(io
);
return ((*devsw
[io
->i_ino
.i_dev
].dv_ioctl
)(io
, cmd
, arg
));