mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
33659ebbae
commit
7b6d91daee
47 changed files with 242 additions and 289 deletions
|
|
@ -716,7 +716,7 @@ static int _osd_req_list_objects(struct osd_request *or,
|
|||
return PTR_ERR(bio);
|
||||
}
|
||||
|
||||
bio->bi_rw &= ~(1 << BIO_RW);
|
||||
bio->bi_rw &= ~REQ_WRITE;
|
||||
or->in.bio = bio;
|
||||
or->in.total_bytes = bio->bi_size;
|
||||
return 0;
|
||||
|
|
@ -814,7 +814,7 @@ void osd_req_write(struct osd_request *or,
|
|||
{
|
||||
_osd_req_encode_common(or, OSD_ACT_WRITE, obj, offset, len);
|
||||
WARN_ON(or->out.bio || or->out.total_bytes);
|
||||
WARN_ON(0 == bio_rw_flagged(bio, BIO_RW));
|
||||
WARN_ON(0 == (bio->bi_rw & REQ_WRITE));
|
||||
or->out.bio = bio;
|
||||
or->out.total_bytes = len;
|
||||
}
|
||||
|
|
@ -829,7 +829,7 @@ int osd_req_write_kern(struct osd_request *or,
|
|||
if (IS_ERR(bio))
|
||||
return PTR_ERR(bio);
|
||||
|
||||
bio->bi_rw |= (1 << BIO_RW); /* FIXME: bio_set_dir() */
|
||||
bio->bi_rw |= REQ_WRITE; /* FIXME: bio_set_dir() */
|
||||
osd_req_write(or, obj, offset, bio, len);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -865,7 +865,7 @@ void osd_req_read(struct osd_request *or,
|
|||
{
|
||||
_osd_req_encode_common(or, OSD_ACT_READ, obj, offset, len);
|
||||
WARN_ON(or->in.bio || or->in.total_bytes);
|
||||
WARN_ON(1 == bio_rw_flagged(bio, BIO_RW));
|
||||
WARN_ON(1 == (bio->bi_rw & REQ_WRITE));
|
||||
or->in.bio = bio;
|
||||
or->in.total_bytes = len;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue