summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the disk(9) API in order to make device removal more robust.phk2004-02-181-23/+31
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* don't call sbuf_clear() right after sbuf_new(), it is not necessary.phk2004-02-101-1/+0
|
* Allow decreasing access count even if there is no disk anymore.pjd2004-02-061-3/+11
| | | | | | This will allow closing disks that were removed while opened. Approved by: phk, scottl (mentor)
* Remove no longer necessary debug printfsphk2004-01-231-6/+0
|
* Correct usage of mtx_init() API. This is not a functional change sincetruckman2003-12-071-1/+1
| | | | | | the code happened to work because MTX_DEF and NULL are both defined as 0. Reviewed by: phk
* Retire bio_blkno entirely.phk2003-10-181-1/+0
| | | | | | bio_offset is the field drivers should use. bio_pblkno remains as a convenient place to store the number of the device drivers.
* Return ENODEV in case the driver has no dump routine.phk2003-09-291-0/+4
|
* Be more careful in dumpconf: softc may be NULL for departing devices.phk2003-09-231-3/+6
| | | | Allow drivers to initialize the d_devstat if they want magic params.
* Simplify the ioctl handling in GEOM.phk2003-09-011-10/+20
| | | | | | | | | | | | | | | 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.
* Try to close the race between disk_destroy() and a subsequent disk_create().phk2003-09-011-19/+17
|
* Use __FBSDID().obrien2003-06-111-2/+3
| | | | Approved by: phk
* Introduce a init and fini member functions on a class.phk2003-05-311-5/+14
| | | | | | | | | Use ->init() and ->fini() to handle the mutex in geom_disk.c Remove the g_add_class() function and replace it with a standardized g_modevent() function. This adds the basic infrastructure for loading/unloading GEOM classes
* Remove the G_CLASS_INITIALIZER, we do not need it anymore.phk2003-05-311-1/+0
|
* Don't do silly thing if the disk_create() event gets canceled.phk2003-05-251-1/+3
| | | | Approved by: re/scottl
* Return ENXIO if the softc pointer is NULL, in all likelyhood thephk2003-05-211-0/+4
| | | | | | disk is in the process of disappearing. Approved by: re/rwats*
* When a disk disappears, destroy the class from the event threadphk2003-05-121-1/+10
| | | | | | to avoid race condtion. Approved by: re/rwatson
* Use g_wither_geom() for cleanup.phk2003-05-021-2/+1
|
* Introduce a g_waitfor_event() function which posts an event and waits forphk2003-04-231-5/+1
| | | | it to be run (or cancelled) and use this instead of home-rolled versions.
* Rename g_call_me() to g_post_event(), and give it a flagphk2003-04-231-5/+4
| | | | argument to determine if we can M_WAITOK in malloc.
* Remove all references to BIO_SETATTR. We will not be using it.phk2003-04-031-3/+0
|
* Add handling for cancelled events in the g_call_me() methods.phk2003-04-021-2/+15
|
* Change events to have an array of "void *" references, and give thephk2003-04-021-4/+4
| | | | | | | | | | | event posting functions varargs to fill these. Attribute g_call_me() to appropriate g_geom's where necessary. Add a flag argument to g_call_me() methods which will be used to signal cancellation of events in the future. This commit should be a no-op.
* Include <geom/geom_disk.h> not <sys/disk.h>phk2003-04-011-1/+1
|
* Check return value of g_call_me()phk2003-03-271-4/+5
|
* Premptively change initializations of struct g_class to use C99phk2003-03-241-3/+1
| | | | | sparse struct initializations before we extend the struct with new OAM related member functions.
* Mitigate deadlock situation pending a more complete solution.phk2003-03-211-1/+3
|
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-181-1/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* Use devstat_{start,end}_transaction_bio().phk2003-03-151-10/+3
| | | | Remember to set bio_resid correctly first.
* Allocate devstat structure with devstat_new_entry().phk2003-03-081-2/+1
|
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-1/+29
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* NO_GEOM cleanup:phk2003-02-281-54/+10
| | | | | Retire the "dev_t" centric version of the disk mini-layer. Remove now unneeded linkage field in dev_t and struct disk.
* NO_GEOM cleanup:phk2003-02-211-2/+2
| | | | | | | | | | | | | Retire the "d_dump_t" and use the "dumper_t" type instead. Dumper_t takes a void * as first arg which is more general than the dev_t taken by d_dump_t. (Remember: we could have net-dumpers if somebody wrote us one!) Define the convention for GEOM controlled disk devices to be that the first argument to the dumper function is the struct disk pointer. Change device drivers accordingly.
* NO_GEOM cleanup:phk2003-02-211-4/+2
| | | | | | | | Change the argument to disk_destroy() to be the same struct disk * as disk_create() takes. This enables drivers to ignore the (now) bogus dev_t which disk_create() returns.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Correctly set bio_data in cloned children when cutting up large requests.tegge2003-02-121-1/+1
|
* Check disk->d_maxsize/dev->si_iosize_max at open time rather than in strategy.phk2003-02-111-10/+7
| | | | Printf a warning and use DFLTPHYS if the drive has not set a size.
* Make a mutex to stop the race coming into geom_disk's done routine.phk2003-02-111-25/+61
| | | | | | | | Cut up requests into smaller bits if they are longer than the drivers disk->d_maxsize or dev->si_iosize_max. Properly handle the race condition when using g_clone_bio() is used without having the single-threadedness of g_down/g_up secure locking.
* Better names for struct disk elements: d_maxsize, d_stripeoffsetphk2003-02-111-0/+2
| | | | | | | | | | | and d_stripesisze; Introduce si_stripesize and si_stripeoffset in struct cdev so we can make the visible to clustering code. Add stripesize and stripeoffset to providers. DTRT with stripesize and stripeoffset in various places in GEOM.
* Propagate DISKFLAG_CANDELETE from struct disk to G_PF_CANDELETE on thephk2003-02-111-8/+11
| | | | provider.
* Check return value of g_clone_bio().phk2003-02-061-0/+4
|
* Experimentally don't let go of Giant in geom_disk's done.phk2003-02-061-0/+5
| | | | | | | We may actually be increasing Giant contention doing so because the actual stuff we do is very cheap. Also I am not convinced there is not a tiny window for a race here.
* Implement the new "struct disk" centered API for device drivers.phk2003-02-051-12/+23
| | | | | This commit should not change anything as no device drivers use the new API yet.
* Pave the road to removing the fixed size limit on device nodes:phk2003-02-041-0/+2
| | | | | | | | | | Change the si_name of dev_t's to be a char * and put a private buffer for holding the name at then end of the struct. Initialize si_name to point to the private buffer. Put a KASSERT in geom_disk to prevent overrun on the fake dev_t we still have to generate for the disk_drivers.
* Add a bio_disk pointer for use between geom_disk and the device drivers.phk2003-02-021-2/+2
|
* Add some agility to the disk_create() API:phk2003-01-301-24/+48
| | | | | | | | | | | | | | | | | | | Make passing the methods in a cdevsw structure optional. Move "CANFREE" and "NOGIANT" flags into struct disk instead of the cdevsw which may or may not be there. Rename CANFREE to CANDELETE to match BIO_DELETE operation. Add "OPEN" flag so drivers don't have to provide open/close methods just to maintain such a flag. Add temporary stopgap include of <sys/conf.h> to <sys/disk.h> until the files which have them in the other order are fixed. Add KASSERTS to make sure we don't get fed too many NULL pointers. Clear our geom's softc pointer before we wither.
* NO_GEOM cleanup: Remove sys/disklabel.h include.phk2003-01-301-2/+1
|
* NO_GEOM cleanup: retire disk_invalidate()phk2003-01-301-5/+0
|
* NO_GEOM cleanup: Mark the last arg to disk_create() as unused.phk2003-01-301-1/+1
|
* Add code to repsect the D_NOGIANT flag, should the disk device driver set it.phk2003-01-291-11/+30
| | | | | | NO_GEOM cleanup: remove ifdefs. Still untested.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
OpenPOWER on IntegriCloud