Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166335081
D31830.id94646.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31830.id94646.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D31830: fd: Move from using device_busy to a refcount
Attached
Detach File
Event Timeline
Log In to Comment