diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-10-11 18:44:27 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:47 -0500 |
commit | 4f024f3797c43cb4b73cd2c50cec728842d0e49e (patch) | |
tree | 3aedcab02d2ad723a189d01934d1e94fec7a54e1 /Documentation/block | |
parent | ed9c47bebeeea4a468b07cfd745c690190f8014c (diff) |
block: Abstract out bvec iterator
Immutable biovecs are going to require an explicit iterator. To
implement immutable bvecs, a later patch is going to add a bi_bvec_done
member to this struct; for now, this patch effectively just renames
things.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Yehuda Sadeh <yehuda@inktank.com>
Cc: Sage Weil <sage@inktank.com>
Cc: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Cc: Joshua Morris <josh.h.morris@us.ibm.com>
Cc: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: Boaz Harrosh <bharrosh@panasas.com>
Cc: Benny Halevy <bhalevy@tonian.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Chris Mason <chris.mason@fusionio.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: Joern Engel <joern@logfs.org>
Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Ben Myers <bpm@sgi.com>
Cc: xfs@oss.sgi.com
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Guo Chao <yan@linux.vnet.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Asai Thambi S P <asamymuthupa@micron.com>
Cc: Selvan Mani <smani@micron.com>
Cc: Sam Bradshaw <sbradshaw@micron.com>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchand@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andy Adamson <andros@netapp.com>
Cc: fanchaoting <fanchaoting@cn.fujitsu.com>
Cc: Jie Liu <jeff.liu@oracle.com>
Cc: Sunil Mushran <sunil.mushran@gmail.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Pankaj Kumar <pankaj.km@samsung.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Mel Gorman <mgorman@suse.de>6
Diffstat (limited to 'Documentation/block')
-rw-r--r-- | Documentation/block/biodoc.txt | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt index 8df5e8e6dceb..2101e718670d 100644 --- a/Documentation/block/biodoc.txt +++ b/Documentation/block/biodoc.txt | |||
@@ -447,14 +447,13 @@ struct bio_vec { | |||
447 | * main unit of I/O for the block layer and lower layers (ie drivers) | 447 | * main unit of I/O for the block layer and lower layers (ie drivers) |
448 | */ | 448 | */ |
449 | struct bio { | 449 | struct bio { |
450 | sector_t bi_sector; | ||
451 | struct bio *bi_next; /* request queue link */ | 450 | struct bio *bi_next; /* request queue link */ |
452 | struct block_device *bi_bdev; /* target device */ | 451 | struct block_device *bi_bdev; /* target device */ |
453 | unsigned long bi_flags; /* status, command, etc */ | 452 | unsigned long bi_flags; /* status, command, etc */ |
454 | unsigned long bi_rw; /* low bits: r/w, high: priority */ | 453 | unsigned long bi_rw; /* low bits: r/w, high: priority */ |
455 | 454 | ||
456 | unsigned int bi_vcnt; /* how may bio_vec's */ | 455 | unsigned int bi_vcnt; /* how may bio_vec's */ |
457 | unsigned int bi_idx; /* current index into bio_vec array */ | 456 | struct bvec_iter bi_iter; /* current index into bio_vec array */ |
458 | 457 | ||
459 | unsigned int bi_size; /* total size in bytes */ | 458 | unsigned int bi_size; /* total size in bytes */ |
460 | unsigned short bi_phys_segments; /* segments after physaddr coalesce*/ | 459 | unsigned short bi_phys_segments; /* segments after physaddr coalesce*/ |
@@ -480,7 +479,7 @@ With this multipage bio design: | |||
480 | - Code that traverses the req list can find all the segments of a bio | 479 | - Code that traverses the req list can find all the segments of a bio |
481 | by using rq_for_each_segment. This handles the fact that a request | 480 | by using rq_for_each_segment. This handles the fact that a request |
482 | has multiple bios, each of which can have multiple segments. | 481 | has multiple bios, each of which can have multiple segments. |
483 | - Drivers which can't process a large bio in one shot can use the bi_idx | 482 | - Drivers which can't process a large bio in one shot can use the bi_iter |
484 | field to keep track of the next bio_vec entry to process. | 483 | field to keep track of the next bio_vec entry to process. |
485 | (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE) | 484 | (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE) |
486 | [TBD: Should preferably also have a bi_voffset and bi_vlen to avoid modifying | 485 | [TBD: Should preferably also have a bi_voffset and bi_vlen to avoid modifying |
@@ -589,7 +588,7 @@ driver should not modify these values. The block layer sets up the | |||
589 | nr_sectors and current_nr_sectors fields (based on the corresponding | 588 | nr_sectors and current_nr_sectors fields (based on the corresponding |
590 | hard_xxx values and the number of bytes transferred) and updates it on | 589 | hard_xxx values and the number of bytes transferred) and updates it on |
591 | every transfer that invokes end_that_request_first. It does the same for the | 590 | every transfer that invokes end_that_request_first. It does the same for the |
592 | buffer, bio, bio->bi_idx fields too. | 591 | buffer, bio, bio->bi_iter fields too. |
593 | 592 | ||
594 | The buffer field is just a virtual address mapping of the current segment | 593 | The buffer field is just a virtual address mapping of the current segment |
595 | of the i/o buffer in cases where the buffer resides in low-memory. For high | 594 | of the i/o buffer in cases where the buffer resides in low-memory. For high |