Page MenuHomeFreeBSD

D31830.id94646.diff
No OneTemporary

D31830.id94646.diff

Index: sys/dev/fdc/fdc.c
===================================================================
--- sys/dev/fdc/fdc.c
+++ sys/dev/fdc/fdc.c
@@ -260,6 +260,7 @@
struct g_geom *fd_geom;
struct g_provider *fd_provider;
device_t dev;
+ u_int ref;
struct bio_queue_head fd_bq;
};
@@ -1431,7 +1432,7 @@
if (ar == 0 && aw == 0 && ae == 0) {
fd->options &= ~(FDOPT_NORETRY | FDOPT_NOERRLOG | FDOPT_NOERROR);
- device_unbusy(fd->dev);
+ refcount_release(&fd->ref);
return (0);
}
@@ -1453,13 +1454,13 @@
fd->flags &= ~FD_NEWDISK;
mtx_unlock(&fdc->fdc_mtx);
}
- device_busy(fd->dev);
+ refcount_acquire(&fd->ref);
busy = 1;
}
if (w > 0 && (fd->flags & FD_WP)) {
if (busy)
- device_unbusy(fd->dev);
+ refcount_release(&fd->ref);
return (EROFS);
}
@@ -2071,8 +2072,8 @@
fd = device_get_softc(dev);
g_waitfor_event(fd_detach_geom, fd, M_WAITOK, NULL);
- while (device_get_state(dev) == DS_BUSY)
- tsleep(fd, PZERO, "fdd", hz/10);
+ while (refcount_load(&fd->ref) != 0)
+ pause(1);
callout_drain(&fd->toffhandle);
return (0);

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 13, 11:47 PM (1 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36605794
Default Alt Text
D31830.id94646.diff (1 KB)

Event Timeline