Commit Graph

601 Commits

Author SHA1 Message Date
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
phk
99d28702f5 Reorder a couple of KASSERTS to give more sensible messages.
Found by:	GEOM 101 class of '03
2003-09-11 00:49:02 +00:00
phk
bab9696ceb Correct bzero length so we clear the entire key structure. 2003-09-08 18:35:26 +00:00
phk
db461ec795 Bzero the right number of bytes.
Found by:	Juergen Buchmueller <pullmoll@stop1984.com>
2003-09-06 18:37:17 +00:00
phk
862461d8b4 Make sure to return ENOIOCTL if the ioctl is not handled. 2003-09-04 21:23:46 +00:00
phk
38290a3baa Simplify the ioctl handling in GEOM.
This replaces the current ioctl processing with a direct call path
from geom_dev() where the ioctl arrives (from SPECFS) to any directly
connected GEOM class.

The inverse of the above is no longer supported.  This is the
situation were you have one or more intervening GEOM classes, for
instance a BSDlabel on top of a MBR or PC98.  If you want to issue
MBR or PC98 specific ioctls, you will need to issue them on a MBR
or PC98 providers.

This paves the way for inviting CD's, FD's and other special cases
inside GEOM.
2003-09-01 20:45:32 +00:00
phk
9958b55dce Try to close the race between disk_destroy() and a subsequent disk_create(). 2003-09-01 12:03:13 +00:00
phk
a802e42c5a Add the new g_dev_getprovider() function, the swap_pager needs it now.
Spotted by:	mr
2003-08-30 18:33:55 +00:00
ps
3f7f2a4cfc Change the the size fields to daddr_t to support greater than 2TB ccd volumes.
Reviewed by:	phk
2003-08-22 11:21:06 +00:00
phk
57ee24a70a Make CCD unloadable. 2003-08-22 11:04:47 +00:00
phk
ec0641f616 Don't panic over the fact that unloading failed if we already knew that. 2003-08-22 11:00:54 +00:00
phk
0955331370 Block all GETATTR calls hitting the CCD, we wouldn't know which child
device should handle them.

This prevents for instance GEOM::ioctl requests from reaching a
lower BSDlabel node, which ps@ found would confuse newfs(8).
2003-08-22 10:28:19 +00:00
phk
d2368e58de Check for null softc pointers, these happens when a ccd is withering.
Found by:	 David Schultz <dschultz@OCF.Berkeley.EDU>
2003-08-22 10:22:46 +00:00
phk
b43271d3a4 Replace a panic with a .1Hz retry loop.
Not a perfect solution, but far cheaper than one.
2003-08-13 12:35:25 +00:00
phk
b35539c7d2 In case we encounter a zero sectorsize provider in g_io_check(), fail
the request with a printf rather than a divide by zero error.
2003-08-13 06:42:56 +00:00
phk
4a97de3d53 Kick Giant compatibility one layer up. 2003-08-02 10:11:58 +00:00
phk
f1458a1700 Fix a memory leak in CCD's mirror code. 2003-07-29 20:04:06 +00:00
phk
2d9e322722 Implement DOSPTYP_EXTLBA more completely: loop until we find no more
partitions.

Submitted by:	Rudolf Cejka <cejkar@fit.vutbr.cz>
PR:	53719
2003-07-29 10:09:13 +00:00
phk
47a98bb53f Handle geoms which are withering away specially in the dump functions. 2003-07-08 21:12:40 +00:00
phk
cee4a6c39a Only dump 512 bytes of debugging.
Always wait for things to settle before returning.
2003-07-02 08:07:07 +00:00
phk
57f7d6f488 Sleep on "-" in our normal state to simplify debugging. 2003-06-18 10:33:09 +00:00
phk
84a309987c Add "GEOM_FOX", a class which detects and selects between multiple
redundant paths to the same device.

This class reacts to a label in the first sector of the device,
which is created the following way:

        #    "0123456789abcdef012345..."
        #    "<----magic-----><-id-...>
        echo "GEOM::FOX       someid" | dd of=/dev/da0 conv=sync

NB: Since the fact that multiple disk devices are in fact the same
    device is not known to GEOM, the geom taste/spoil process cannot
    fully catch all corner cases and this module can therefore be
    confused if you do the right wrong things.

NB: The disk level drivers need to do the right thing for this to
    be useful, and that is not by definition currently the case.
2003-06-18 09:29:28 +00:00
obrien
40ee2bd5c8 Use __FBSDID().
Approved by:	phk
2003-06-11 06:49:16 +00:00
phk
96300d6f8f Fix error handling for ENOMEM style issues. 2003-06-09 19:12:19 +00:00
phk
8d105bca1c Improve the root-dev prompt facility for printing devices which could
possibly be a root filesystem.
2003-06-07 15:46:53 +00:00
phk
c9fca2ba58 Wait for everything to settle before we try to print the list of
geom devices.
2003-06-07 15:32:09 +00:00
phk
01274259b9 Make sure we return an error message if the geom parameter is not
located.
2003-06-07 15:31:44 +00:00
phk
727d06d199 Polishing and nitpicking. 2003-06-07 11:06:44 +00:00
phk
dd1aaed417 Drop a memory-corruption debugging test-tool. 2003-06-07 10:55:48 +00:00
phk
69b4e9ce01 Add missing va_end() calls.
Noticed by:	tmm
2003-06-07 10:16:53 +00:00
phk
e23e34a198 Introduce g_provider_by_name() function, and use it. 2003-06-04 18:17:52 +00:00
phk
9e9ac1e55e Make this a true GEOM class:
Attach to the component devices using GEOM semantics.
        Create a GEOM provider instead of using disk_create()
        Use the GEOM OAM api for configuration.

I saw approx ~1% speedup in througput and ~7% in latency in a
simple minded test of a two-disk striped device.

This file was repo-copied from src/sys/dev/ccd/ccd.c.

This is not yet linked into the build.
2003-06-04 18:16:09 +00:00
phk
1ee949187c Add a KASSERT to prevent the same GEOM class from being processed loaded
twice.

Enforce that classes should have different names while we are here.
2003-06-04 17:51:10 +00:00
phk
52a564bd3f Further devilification of CCD:
Change the list interface to simplify things.
Remove old list ioctls which bogusly exported the softc to userland.
Move the softc and associated structures from the public header to
the source file.
2003-06-02 21:29:04 +00:00
phk
44a9a5c714 Begin deevilification of CCD:
Make CCD a GEOM class.

For now only use this for implementing a OAM config method which
can return a list of configured CCD devices in the format which
"ccdconfig -g[v]" would normally output.
2003-06-02 20:50:03 +00:00
phk
9a8f0922c0 Return an indicative error message. 2003-06-02 20:35:37 +00:00