diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c index 0e10e200eab..99333d47272 100644 --- a/sys/i386/isa/atapi-cd.c +++ b/sys/i386/isa/atapi-cd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-cd.c,v 1.16 1999/04/28 10:52:16 dt Exp $ + * $Id: atapi-cd.c,v 1.17 1999/05/07 07:03:23 phk Exp $ */ #include "wdc.h" @@ -93,7 +93,6 @@ static void acd_describe(struct acd *); static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char); static int acd_eject(struct acd *, int); static void acd_select_slot(struct acd *); -static int acd_rezero_unit(struct acd *); static int acd_open_disk(struct acd *, int); static int acd_open_track(struct acd *, struct wormio_prepare_track *); static int acd_close_track(struct acd *); @@ -411,21 +410,8 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p) else ++cdp->refcnt; - if ((flags & O_NONBLOCK) == 0) { - if ((flags & FWRITE) != 0) { - /* read/write */ - if (acd_rezero_unit(cdp)) { - printf("wcd%d: rezero failed\n", lun); - return EIO; - } - } else { - /* read only */ - if (acd_read_toc(cdp) != 0) { - printf("wcd%d: read_toc failed\n", lun); - /* return EIO; */ - } - } - } + if (!(flags & O_NONBLOCK) && acd_read_toc(cdp) && !(flags & FWRITE)) + printf("acd%d: read_toc failed\n", lun); return 0; } @@ -1271,13 +1257,6 @@ acd_select_slot(struct acd *cdp) } } -static int -acd_rezero_unit(struct acd *cdp) -{ - return acd_request_wait(cdp, ATAPI_REZERO_UNIT, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0); -} - static int acd_open_disk(struct acd *cdp, int test) { diff --git a/sys/i386/isa/wd_cd.c b/sys/i386/isa/wd_cd.c index 0e10e200eab..99333d47272 100644 --- a/sys/i386/isa/wd_cd.c +++ b/sys/i386/isa/wd_cd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-cd.c,v 1.16 1999/04/28 10:52:16 dt Exp $ + * $Id: atapi-cd.c,v 1.17 1999/05/07 07:03:23 phk Exp $ */ #include "wdc.h" @@ -93,7 +93,6 @@ static void acd_describe(struct acd *); static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char); static int acd_eject(struct acd *, int); static void acd_select_slot(struct acd *); -static int acd_rezero_unit(struct acd *); static int acd_open_disk(struct acd *, int); static int acd_open_track(struct acd *, struct wormio_prepare_track *); static int acd_close_track(struct acd *); @@ -411,21 +410,8 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p) else ++cdp->refcnt; - if ((flags & O_NONBLOCK) == 0) { - if ((flags & FWRITE) != 0) { - /* read/write */ - if (acd_rezero_unit(cdp)) { - printf("wcd%d: rezero failed\n", lun); - return EIO; - } - } else { - /* read only */ - if (acd_read_toc(cdp) != 0) { - printf("wcd%d: read_toc failed\n", lun); - /* return EIO; */ - } - } - } + if (!(flags & O_NONBLOCK) && acd_read_toc(cdp) && !(flags & FWRITE)) + printf("acd%d: read_toc failed\n", lun); return 0; } @@ -1271,13 +1257,6 @@ acd_select_slot(struct acd *cdp) } } -static int -acd_rezero_unit(struct acd *cdp) -{ - return acd_request_wait(cdp, ATAPI_REZERO_UNIT, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0); -} - static int acd_open_disk(struct acd *cdp, int test) { diff --git a/sys/pc98/pc98/wd_cd.c b/sys/pc98/pc98/wd_cd.c index 0e10e200eab..99333d47272 100644 --- a/sys/pc98/pc98/wd_cd.c +++ b/sys/pc98/pc98/wd_cd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-cd.c,v 1.16 1999/04/28 10:52:16 dt Exp $ + * $Id: atapi-cd.c,v 1.17 1999/05/07 07:03:23 phk Exp $ */ #include "wdc.h" @@ -93,7 +93,6 @@ static void acd_describe(struct acd *); static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char); static int acd_eject(struct acd *, int); static void acd_select_slot(struct acd *); -static int acd_rezero_unit(struct acd *); static int acd_open_disk(struct acd *, int); static int acd_open_track(struct acd *, struct wormio_prepare_track *); static int acd_close_track(struct acd *); @@ -411,21 +410,8 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p) else ++cdp->refcnt; - if ((flags & O_NONBLOCK) == 0) { - if ((flags & FWRITE) != 0) { - /* read/write */ - if (acd_rezero_unit(cdp)) { - printf("wcd%d: rezero failed\n", lun); - return EIO; - } - } else { - /* read only */ - if (acd_read_toc(cdp) != 0) { - printf("wcd%d: read_toc failed\n", lun); - /* return EIO; */ - } - } - } + if (!(flags & O_NONBLOCK) && acd_read_toc(cdp) && !(flags & FWRITE)) + printf("acd%d: read_toc failed\n", lun); return 0; } @@ -1271,13 +1257,6 @@ acd_select_slot(struct acd *cdp) } } -static int -acd_rezero_unit(struct acd *cdp) -{ - return acd_request_wait(cdp, ATAPI_REZERO_UNIT, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0); -} - static int acd_open_disk(struct acd *cdp, int test) {