block: unify flags for struct bio and struct request
Remove the current bio flags and reuse the request flags for the bio, too. This allows to more easily trace the type of I/O from the filesystem down to the block driver. There were two flags in the bio that were missing in the requests: BIO_RW_UNPLUG and BIO_RW_AHEAD. Also I've renamed two request flags that had a superflous RW in them. Note that the flags are in bio.h despite having the REQ_ name - as blkdev.h includes bio.h that is the only way to go for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:

committed by
Jens Axboe

parent
33659ebbae
commit
7b6d91daee
@@ -1429,7 +1429,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
|
||||
ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0);
|
||||
BUG_ON(ret);
|
||||
|
||||
if (!(rw & (1 << BIO_RW))) {
|
||||
if (!(rw & REQ_WRITE)) {
|
||||
if (bio_flags & EXTENT_BIO_COMPRESSED) {
|
||||
return btrfs_submit_compressed_read(inode, bio,
|
||||
mirror_num, bio_flags);
|
||||
@@ -1841,7 +1841,7 @@ static int btrfs_io_failed_hook(struct bio *failed_bio,
|
||||
bio->bi_size = 0;
|
||||
|
||||
bio_add_page(bio, page, failrec->len, start - page_offset(page));
|
||||
if (failed_bio->bi_rw & (1 << BIO_RW))
|
||||
if (failed_bio->bi_rw & REQ_WRITE)
|
||||
rw = WRITE;
|
||||
else
|
||||
rw = READ;
|
||||
@@ -5642,7 +5642,7 @@ static void btrfs_submit_direct(int rw, struct bio *bio, struct inode *inode,
|
||||
struct bio_vec *bvec = bio->bi_io_vec;
|
||||
u64 start;
|
||||
int skip_sum;
|
||||
int write = rw & (1 << BIO_RW);
|
||||
int write = rw & REQ_WRITE;
|
||||
int ret = 0;
|
||||
|
||||
skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM;
|
||||
|
Reference in New Issue
Block a user