]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - Documentation/block/biodoc.txt
USB: don't register endpoints for interfaces that are going away
[linux-2.6-omap-h63xx.git] / Documentation / block / biodoc.txt
index 8af392fc6ef0e74b115257b5d31bb4345cd09f9f..4dbb8be1c991c3b4049d69ff68c99c12e5f34ce3 100644 (file)
@@ -2,7 +2,7 @@
        =====================================================
 
 Notes Written on Jan 15, 2002:
        =====================================================
 
 Notes Written on Jan 15, 2002:
-       Jens Axboe <axboe@suse.de>
+       Jens Axboe <jens.axboe@oracle.com>
        Suparna Bhattacharya <suparna@in.ibm.com>
 
 Last Updated May 2, 2002
        Suparna Bhattacharya <suparna@in.ibm.com>
 
 Last Updated May 2, 2002
@@ -21,7 +21,7 @@ Credits:
 ---------
 
 2.5 bio rewrite:
 ---------
 
 2.5 bio rewrite:
-       Jens Axboe <axboe@suse.de>
+       Jens Axboe <jens.axboe@oracle.com>
 
 Many aspects of the generic block layer redesign were driven by and evolved
 over discussions, prior patches and the collective experience of several
 
 Many aspects of the generic block layer redesign were driven by and evolved
 over discussions, prior patches and the collective experience of several
@@ -477,9 +477,9 @@ With this multipage bio design:
   the same bi_io_vec array, but with the index and size accordingly modified)
 - A linked list of bios is used as before for unrelated merges (*) - this
   avoids reallocs and makes independent completions easier to handle.
   the same bi_io_vec array, but with the index and size accordingly modified)
 - A linked list of bios is used as before for unrelated merges (*) - this
   avoids reallocs and makes independent completions easier to handle.
-- Code that traverses the req list needs to make a distinction between
-  segments of a request (bio_for_each_segment) and the distinct completion
-  units/bios (rq_for_each_bio).
+- Code that traverses the req list can find all the segments of a bio
+  by using rq_for_each_segment.  This handles the fact that a request
+  has multiple bios, each of which can have multiple segments.
 - Drivers which can't process a large bio in one shot can use the bi_idx
   field to keep track of the next bio_vec entry to process.
   (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE)
 - Drivers which can't process a large bio in one shot can use the bi_idx
   field to keep track of the next bio_vec entry to process.
   (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE)
@@ -664,14 +664,14 @@ in lvm or md.
 
 3.2.1 Traversing segments and completion units in a request
 
 
 3.2.1 Traversing segments and completion units in a request
 
-The macros bio_for_each_segment() and rq_for_each_bio() should be used for
-traversing the bios in the request list (drivers should avoid directly
-trying to do it themselves). Using these helpers should also make it easier
-to cope with block changes in the future.
+The macro rq_for_each_segment() should be used for traversing the bios
+in the request list (drivers should avoid directly trying to do it
+themselves). Using these helpers should also make it easier to cope
+with block changes in the future.
 
 
-       rq_for_each_bio(bio, rq)
-               bio_for_each_segment(bio_vec, bio, i)
-                       /* bio_vec is now current segment */
+       struct req_iterator iter;
+       rq_for_each_segment(bio_vec, rq, iter)
+               /* bio_vec is now current segment */
 
 I/O completion callbacks are per-bio rather than per-segment, so drivers
 that traverse bio chains on completion need to keep that in mind. Drivers
 
 I/O completion callbacks are per-bio rather than per-segment, so drivers
 that traverse bio chains on completion need to keep that in mind. Drivers
@@ -1097,7 +1097,7 @@ lock themselves, if required. Drivers that explicitly used the
 io_request_lock for serialization need to be modified accordingly.
 Usually it's as easy as adding a global lock:
 
 io_request_lock for serialization need to be modified accordingly.
 Usually it's as easy as adding a global lock:
 
-       static spinlock_t my_driver_lock = SPIN_LOCK_UNLOCKED;
+       static DEFINE_SPINLOCK(my_driver_lock);
 
 and passing the address to that lock to blk_init_queue().
 
 
 and passing the address to that lock to blk_init_queue().