summaryrefslogtreecommitdiffstats
path: root/sys/sys/bio.h
Commit message (Collapse)AuthorAgeFilesLines
* Correct bioq_disksort so that bioq_insert_tail() offers barrier semantic.gibbs2010-09-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the BIO_ORDERED flag for struct bio and update bio clients to use it. The barrier semantics of bioq_insert_tail() were broken in two ways: o In bioq_disksort(), an added bio could be inserted at the head of the queue, even when a barrier was present, if the sort key for the new entry was less than that of the last queued barrier bio. o The last_offset used to generate the sort key for newly queued bios did not stay at the position of the barrier until either the barrier was de-queued, or a new barrier (which updates last_offset) was queued. When a barrier is in effect, we know that the disk will pass through the barrier position just before the "blocked bios" are released, so using the barrier's offset for last_offset is the optimal choice. sys/geom/sched/subr_disk.c: sys/kern/subr_disk.c: o Update last_offset in bioq_insert_tail(). o Only update last_offset in bioq_remove() if the removed bio is at the head of the queue (typically due to a call via bioq_takefirst()) and no barrier is active. o In bioq_disksort(), if we have a barrier (insert_point is non-NULL), set prev to the barrier and cur to it's next element. Now that last_offset is kept at the barrier position, this change isn't strictly necessary, but since we have to take a decision branch anyway, it does avoid one, no-op, loop iteration in the while loop that immediately follows. o In bioq_disksort(), bypass the normal sort for bios with the BIO_ORDERED attribute and instead insert them into the queue with bioq_insert_tail(). bioq_insert_tail() not only gives the desired command order during insertion, but also provides barrier semantics so that commands disksorted in the future cannot pass the just enqueued transaction. sys/sys/bio.h: Add BIO_ORDERED as bit 4 of the bio_flags field in struct bio. sys/cam/ata/ata_da.c: sys/cam/scsi/scsi_da.c Use an ordered command for SCSI/ATA-NCQ commands issued in response to bios with the BIO_ORDERED flag set. sys/cam/scsi/scsi_da.c Use an ordered tag when issuing a synchronize cache command. Wrap some lines to 80 columns. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c sys/geom/geom_io.c Mark bios with the BIO_FLUSH command as BIO_ORDERED. Sponsored by: Spectra Logic Corporation MFC after: 1 month
* only export bio_cmd and flags to userland (bio_cmd areluigi2009-12-111-17/+16
| | | | | | | | | | used by ggatectl, flags are potentially useful). Other parts are internal kernel data structures and should not be visible to userland. No API change involved. MFC after: 3 days
* As discussed in the devsummit, introduce two fields in theluigi2009-06-111-0/+7
| | | | | | | struct bio to store classification information, and a hook for classifier functions that can be called by g_io_request(). This code is from Fabio Checconi as part of his GSOC work.
* Add a new I/O request - BIO_FLUSH, which basically tells providers below topjd2006-10-311-0/+1
| | | | | | | flush their caches. For now will mostly be used by disks to flush their write cache. Sponsored by: home.pl
* Assert proper use of bio_caller1, bio_caller2, bio_cflags, bio_driver1,pjd2006-03-011-0/+5
| | | | | | bio_driver2 and bio_pflags fields. Reviewed by: phk
* Correct division by zero error in comment.kris2005-11-241-1/+1
|
* - switch_point is now unused. This doesn't break module binary compatabilityjeff2005-06-121-1/+0
| | | | since the structure is shrinking, not growing.
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Add bioq_insert_head() function.pjd2004-12-131-0/+1
| | | | OK'd by: phk
* Add more KASSERTS and checks.phk2004-08-301-0/+1
|
* Add bioq_takefirst().phk2004-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | If the bioq is empty, NULL is returned. Otherwise the front element is removed and returned. This can simplify locking in many drivers from: lock() bp = bioq_first(bq); if (bp == NULL) { unlock() return } bioq_remove(bp, bq) unlock to: lock() bp = bioq_takefirst(bq); unlock() if (bp == NULL) return;
* - Add two fields to bio structure: 'bio_cflags' which can be used bypjd2004-08-041-16/+16
| | | | | | | | | | | | consumer and 'bio_pflags' which can be used by provider. - Remove BIO_FLAG1 and BIO_FLAG2 flags. From now on new fields should be used for internal flags. - Update g_bio(9) manual page. - Update some comments. - Update GEOM_MIRROR, which was the only one using BIO_FLAGs. Idea from: phk Reviewed by: phk
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-2/+2
| | | | Bump __FreeBSD_version accordingly.
* Remove advertising clause from University of California Regent's license,imp2004-04-071-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Bring back the geom_bioqueues, they _are_ a good idea.phk2004-01-281-1/+3
| | | | ATA will uses these RSN.
* 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.
* Make bioq_disksort() sort on the bio_offset field instead of bio_pblkno.phk2003-10-181-1/+1
|
* Retire the experimental bio_taskqueue(), it was not quite as usable asphk2003-04-121-2/+0
| | | | | hoped. It can be revived from here, should other drivers be able to use it.
* Remove BIO_SETATTR from non-GEOM part of kernel as well.phk2003-04-031-1/+0
|
* Remove the #define for bioqdisksort(), it's no longer needed.phk2003-04-011-1/+0
|
* Introduce bioq_flush() function.phk2003-04-011-0/+1
|
* retire the "busy" field in bioqueues, it's served it's purpose.phk2003-03-301-1/+0
|
* Preparation commit before I start on the bioqueue lockdown:phk2003-03-301-18/+3
| | | | | Collect all the bits of bioqueue handing in subr_disk.c, vfs_bio.c is big enough as it is and disksort already lives in subr_disk.c.
* Implement a bio-taskqueue to reduce number of context switches inphk2003-02-111-0/+9
| | | | | | | | | | | | | | | | | | | | disk I/O processing. The intent is that the disk driver in its hardware interrupt routine will simply schedule the bio on the task queue with a routine to finish off whatever needs done. The g_up thread will then schedule this routine, the likely outcome of which is a biodone() which queues the bio on g_up's regular queue where it will be picked up and processed. Compared to the using the regular taskqueue, this saves one contextswitch. Change our scheduling of the g_up and g_down queues to be water-tight, at the cost of breaking the userland regression test-shims. Input and ideas from: scottl
* Commit the correct copy of the g_stat structure.phk2003-02-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add debug.sizeof.g_stat sysctl. Set the id field of the g_stat when we create consumers and providers. Remove biocount from consumer, we will use the counters in the g_stat structure instead. Replace one field which will need to be atomically manipulated with two fields which will not (stat.nop and stat.nend). Change add companion field to bio_children: bio_inbed for the exact same reason. Don't output the biocount in the confdot output. Fix KASSERT in g_io_request(). Add sysctl kern.geom.collectstats defaulting to off. Collect the following raw statistics conditioned on this sysctl: for each consumer and provider { total number of operations started. total number of operations completed. time last operation completed. sum of idle-time. for each of BIO_READ, BIO_WRITE and BIO_DELETE { number of operations completed. number of bytes completed. number of ENOMEM errors. number of other errors. sum of transaction time. } } API for getting hold of these statistics data not included yet.
* Rename bio_linkage to the more obvious bio_parent.phk2003-02-071-1/+2
| | | | Add bio_t0 timestamp, and include <sys/time.h> where needed
* Add a bio_disk pointer for use between geom_disk and the device drivers.phk2003-02-021-0/+2
|
* NO_GEOM cleanup: Rip out iodone_chain with a big smile on my face.phk2003-01-301-13/+0
|
* Add a field for tallying the number of spawned bio's a bio has.phk2002-10-091-5/+6
| | | | | | Rearrange and comment some GEOM related fields. Sponsored by: DARPA & NAI Labs.
* Make FreeBSD "struct disklabel" agnostic, step 312 of 723:phk2002-09-201-0/+2
| | | | | | | | | | Rename bioqdisksort() to bioq_disksort(). Keep a #define around to avoid changing all diskdrivers right now. Move it from subr_disklabel.c to subr_disk.c. Move prototype from <sys/disklabel.h> to <sys/bio.h> Sponsored by: DARPA and NAI Labs.
* Remove the unused _bio_buf field. I can't even remember if this ever gotphk2002-09-151-1/+0
| | | | | | to be used in the first place. Spotted by: bde
* Un-inline the non-trivial "trivial" bio* functions.phk2002-09-141-55/+6
| | | | Untangle devstat_end_transaction_bio()
* Oops, broke the build there. Uninline biodone() now that it is non-trivial.phk2002-09-131-9/+2
| | | | | | | | | Introduce biowait() function. Currently there is a race condition and the mitigation is a timeout/retry. It is not obvious what kind of locking (if any) is suitable for BIO_DONE, since the majority of users take are of this themselves, and only a few places actually rely on the wakeup. Sponsored by: DARPA & NAI Labs.
* Make biodone() default to wakeup() on the struct bio if no bio_donephk2002-09-131-1/+4
| | | | method was specified.
* Forward declare struct uio so that <sys/uio.h> isn't a prerequisite.bde2002-09-051-3/+2
| | | | Removed bogus forward declarations of structs.
* Make daddr_t and u_daddr_t 64bits wide.phk2002-05-141-3/+3
| | | | | | Retire daddr64_t and use daddr_t instead. Sponsored by: DARPA & NAI Labs.
* Constifixion of bio_attribute.phk2002-04-091-1/+1
|
* Push BIO_FORMAT into a local hack inside the floppy drivers wherephk2002-03-261-3/+2
| | | | it belongs.
* Fixed some style bugs in the removal of __P(()). The main ones werebde2002-03-231-2/+2
| | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
* Remove __Palfred2002-03-191-9/+9
|
* Introduce the new 64-bit size disk block, daddr64_t. Changemckusick2002-03-151-3/+3
| | | | | | | | | | | | the bio and buffer structures to have daddr64_t bio_pblkno, b_blkno, and b_lblkno fields which allows access to disks larger than a Terabyte in size. This change also requires that the VOP_BMAP vnode operation accept and return daddr64_t blocks. This delta should not affect system operation in any way. It merely sets up the necessary interfaces to allow the development of disk drivers that work with these larger disk block addresses. It also allows for the development of UFS2 which will use 64-bit block addresses.
* Augment struct bio for GEOM.phk2002-03-111-4/+14
|
* GC: BIO_ORDERED, various infrastructure dealing with BIO_ORDERED.phk2002-02-221-5/+1
|
* Define BIO_CMD{1,2}, available for local hacks, similar to the alreadyjoerg2001-06-291-0/+4
| | | | existing BIO_FLAG{1,2}. To be used in the fdc(4) driver soon.
* Actually biofinish(struct bio *, struct devstat *, int error) is more generalphk2001-05-061-5/+13
| | | | | | than the bioerror(). Most of this patch is generated by scripts.
* Introduce bioerror(struct bio*, int err, int complete);phk2001-05-061-0/+10
|
* A bit of sanity-checking in bioqdisksort(): panic if we recurse.phk2001-01-141-0/+1
|
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-451/+10
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
OpenPOWER on IntegriCloud