FreeBSD Bugzilla – Attachment 88347 Details for
Bug 125139
[patch] [ata] bugs in ATAPI CD tray control
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
atapi-cd-tray-control-fixes.diff
atapi-cd-tray-control-fixes.diff (text/plain), 1.93 KB, created by
Jaakko Heinonen
on 2008-07-01 11:00:11 UTC
(
hide
)
Description:
atapi-cd-tray-control-fixes.diff
Filename:
MIME Type:
Creator:
Jaakko Heinonen
Created:
2008-07-01 11:00:11 UTC
Size:
1.93 KB
patch
obsolete
>Index: sys/dev/ata/atapi-cd.c >=================================================================== >--- sys/dev/ata/atapi-cd.c (revision 180023) >+++ sys/dev/ata/atapi-cd.c (working copy) >@@ -246,11 +246,19 @@ acd_geom_ioctl(struct g_provider *pp, u_ > break; > > case CDIOCALLOW: >+ if (cdp->gnp != 1 || pp->acr != 1) { >+ error = EBUSY; >+ break; >+ } > error = acd_prevent_allow(dev, 0); > cdp->flags &= ~F_LOCKED; > break; > > case CDIOCPREVENT: >+ if (cdp->gnp != 1 || pp->acr != 1) { >+ error = EBUSY; >+ break; >+ } > error = acd_prevent_allow(dev, 1); > cdp->flags |= F_LOCKED; > break; >@@ -266,7 +274,7 @@ acd_geom_ioctl(struct g_provider *pp, u_ > break; > > case CDIOCEJECT: >- if (pp->acr != 1) { >+ if (cdp->gnp != 1 || pp->acr != 1) { > error = EBUSY; > break; > } >@@ -274,7 +282,7 @@ acd_geom_ioctl(struct g_provider *pp, u_ > break; > > case CDIOCCLOSE: >- if (pp->acr != 1) >+ if (cdp->gnp != 1 || pp->acr != 1) > break; > error = acd_tray(dev, 1); > break; >@@ -713,12 +721,16 @@ acd_geom_access(struct g_provider *pp, i > ata_free_request(request); > > if (pp->acr == 0) { >+ cdp->gnp++; > acd_prevent_allow(dev, 1); > cdp->flags |= F_LOCKED; > acd_read_toc(dev); > } > >- if (dr + pp->acr == 0) { >+ if (dr + pp->acr == 0) >+ cdp->gnp--; >+ >+ if (cdp->gnp == 0) { > acd_prevent_allow(dev, 0); > cdp->flags &= ~F_LOCKED; > } >Index: sys/dev/ata/atapi-cd.h >=================================================================== >--- sys/dev/ata/atapi-cd.h (revision 180023) >+++ sys/dev/ata/atapi-cd.h (working copy) >@@ -312,4 +312,6 @@ struct acd_softc { > u_int32_t iomax; /* Max I/O request (bytes) */ > struct g_geom *gp; /* geom instance */ > struct g_provider *pp[MAXTRK+1]; /* providers */ >+ u_int gnp; /* number of geom providers >+ attached to the device */ > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 125139
: 88347