phk
49c92e5706
Change the disk(9) API in order to make device removal more robust.
...
Previously the "struct disk" were owned by the device driver and this
gave us problems when the device disappared and the users of that device
were not immediately disappearing.
Now the struct disk is allocate with a new call, disk_alloc() and owned
by geom_disk and just abandonned by the device driver when disk_create()
is called.
Unfortunately, this results in a ton of "s/\./->/" changes to device
drivers.
Since I'm doing the sweep anyway, a couple of other API improvements
have been carried out at the same time:
The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to
DISKFLAG_NEEDSGIANT
A version number have been added to disk_create() so that we can detect,
report and ignore binary drivers with old ABI in the future.
Manual page update to follow shortly.
2004-02-18 21:36:53 +00:00
phk
c9a89db245
Do not check error code from closing ->access() calls, we know they succeed.
2004-02-14 17:59:44 +00:00
phk
14df0ab802
Add a KASSERT which checks that a class never fails a closing ->access()
...
call.
2004-02-14 17:58:57 +00:00
phk
124977fbb6
Remove the absolute count g_access_abs() function since experience has
...
shown that it is not useful.
Rename the relative count g_access_rel() function to g_access(), only
the name has changed.
Change all g_access_rel() calls in our CVS tree to call g_access() instead.
Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source
code compatibility.
2004-02-12 22:42:11 +00:00
phk
87cf92606a
Give both consumers and providers a {void *private, u_int index} which
...
the implementing class can use to hang internal info from.
2004-02-12 20:32:11 +00:00
pjd
c681583fbc
Added g_print_bio() function to print informations about given bio.
...
Approved by: phk, scottl (mentor)
2004-02-11 18:21:32 +00:00
pjd
1af94a8033
Now we have g_topology_assert_not(), so use it to detect deadlocks.
...
Approved by: phk, scottl (mentor)
2004-02-10 15:55:17 +00:00
pjd
e8bed31902
Added macro which will be used to assert, that the topology lock is not held.
...
Approved by: phk, scottl (mentor)
2004-02-10 15:53:28 +00:00
phk
853b4bc47c
don't call sbuf_clear() right after sbuf_new(), it is not necessary.
2004-02-10 10:54:19 +00:00
phk
3f5293e827
Polish the work/state engine in preparation for HW-crypto support.
2004-02-08 10:19:18 +00:00
phk
fd04c07950
Add a missing error case return.
...
Problem reported by: Flemming Jacobsen <fj@batmule.dk>
2004-02-08 09:39:02 +00:00
phk
bcf2cf333e
We don't need to hold Giant to create the worker kthread.
2004-02-07 23:01:17 +00:00
pjd
9ebcd20d35
Allow decreasing access count even if there is no disk anymore.
...
This will allow closing disks that were removed while opened.
Approved by: phk, scottl (mentor)
2004-02-06 23:10:49 +00:00
le
eb1889fd1b
Fix memory leak.
...
PR: kern/58634
Submitted by: le
Approved by: phk
2004-02-06 22:51:04 +00:00
phk
f0fded48fd
Allow a GEOM class to unload if it has no geoms or a method function to
...
get rid of them.
Prodded by: pjd
2004-02-02 19:49:41 +00:00
pjd
35dc7138a2
- Use proper names in KASSERTs.
...
- Typos.
Approved by: phk, scottl (mentor)
2004-02-02 17:50:09 +00:00
phk
dde6517de7
Check error return from g_clone_bio(). (netchild@)
...
Rearrange code to avoid duplication (phk@)
Submitted by: netchild@
2004-02-02 13:36:06 +00:00
phk
98a9a50f22
Don't mingle malloc/g_event flags.
...
Spotted by: pjd@
2004-02-02 10:58:07 +00:00
phk
d82e43eede
Bring back the geom_bioqueues, they _are_ a good idea.
...
ATA will uses these RSN.
2004-01-28 08:39:18 +00:00
phk
0592926b47
Make sure to keep track of canceled events.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 21:09:38 +00:00
phk
67d8392228
Add KASSERTS.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 21:02:49 +00:00
phk
cd37a85408
Plug an insignificant memoryleak.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 20:40:25 +00:00
phk
148390a292
Add missing newline in printf.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 20:36:21 +00:00
phk
a3cc95eec9
Remove the MD5_KEY debugging tool
2004-01-23 11:47:06 +00:00
phk
e65ee01a8f
Remove no longer necessary debug printfs
2004-01-23 10:56:16 +00:00
phk
437b669def
Print the correct pointer in a KASSERT.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-11 10:02:42 +00:00
phk
cce4827569
KASSERT against no-op access requests.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-09 16:10:32 +00:00
phk
fe692735bf
Prevent withering of the provider we're orphaning from happening until
...
we do it ourselves.
Nailed by: Simon Heath <heath@cng.fr>
2003-12-23 11:37:05 +00:00
truckman
87a37b565f
Correct usage of mtx_init() API. This is not a functional change since
...
the code happened to work because MTX_DEF and NULL are both defined as 0.
Reviewed by: phk
2003-12-07 23:20:53 +00:00
phk
888f0e51c6
KASSERT against multiple orphanings of providers.
2003-12-07 10:04:43 +00:00
scottl
2b68e67c6d
Re-arrange and consolidate some random debugging stuff
2003-12-07 05:04:49 +00:00
phk
d7fc6b258d
Call class->init() an class->fini() while the class is hooked up,
...
rather than right before and right after. This allows these routines
to manipulate the mesh.
KASSERT that nobody creates a geom on an alien class.
Assert topology in g_valid_obj().
Approved by: re@
2003-11-18 18:17:39 +00:00
phk
aeb3231da5
Fix a harmless bug and add a ')' in a debugging printf.
...
Submitted by: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
2003-11-18 07:54:12 +00:00
phk
06ab707e79
This is a crude bandaid for 5.2 to protect against providers which disappear
...
while being tasted. I can moderately easy trigger this with atapi-cd, but
I do not fully understand the circumstances.
2003-11-15 18:44:43 +00:00
phk
01e9462fd6
Make sure to return errors if we have any.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2003-11-12 09:46:54 +00:00
phk
a42d01d036
Close the right consumers if we run into trouble opening them all.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2003-10-24 18:47:31 +00:00
phk
1fd6c526e3
Fix two old/new consumer confusions.
...
Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2003-10-24 18:46:23 +00:00
phk
d7e0132261
Fix a braino memory leak.
...
Found by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2003-10-22 20:28:46 +00:00
phk
5a35d3b764
Forgotten commit: If a provider has zero sectorsize, it is an
...
indication of lack of media.
Tripped up: peter
2003-10-22 06:32:20 +00:00
phk
b7c9250fa7
Remove KASSERT check for negative bio_offsets, add "normal" EIO
...
error return for same.
2003-10-19 19:06:54 +00:00
phk
b3eb57c5d4
Retire bio_blkno entirely.
...
bio_offset is the field drivers should use.
bio_pblkno remains as a convenient place to store the number of
the device drivers.
2003-10-18 17:53:34 +00:00
phk
9d23a3014f
Assume that bp->bio_offset is correctly initialized.
...
This fixes non-power-of-2 blocksize GEOM I/O.
2003-10-12 11:35:55 +00:00
phk
ed350390ed
Destroy providers maked with G_PF_WITHER when the last consumer has detached.
2003-10-12 11:34:35 +00:00
phk
a7b8d85b93
Interior decoration changes.
2003-10-07 09:28:07 +00:00
phk
c7d1762ad7
Allow our bio tools to be used for local bio-chopping by not mandating
...
a bio_from value. bio_to is still mandated (mostly for debuggign) and
shall be copied from the parent bio.
2003-10-06 09:07:35 +00:00
phk
dc1586f843
Introduce a per provider wither flag
2003-10-06 09:05:44 +00:00
phk
9e3e052c16
Return ENODEV in case the driver has no dump routine.
2003-09-29 07:44:23 +00:00
phk
7099deadda
The present defaults for the open and close for device drivers which
...
provide no methods does not make any sense, and is not used by any
driver.
It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.
Change the defaults to be nullopen() and nullclose() which simply
does nothing.
Remove explicit initializations to these from the drivers which
already used them.
2003-09-27 12:01:01 +00:00
phk
4b80280a92
Add more KASSERTS().
2003-09-26 20:52:46 +00:00
phk
ac7d8771f0
Be more careful in dumpconf: softc may be NULL for departing devices.
...
Allow drivers to initialize the d_devstat if they want magic params.
2003-09-23 07:53:59 +00:00