提交 0ea60b5a 编写于 作者: J Jens Axboe

[BLOCK] bio: init ->bi_bdev in bio_init()

For SG_IO requests, bio->bi_bdev may not be explicitly initialized. So make
bio_init() clear the field to make sure it's always NULL or valid.
Signed-off-by: NJens Axboe <axboe@suse.de>
上级 769db45b
......@@ -126,6 +126,7 @@ static void bio_fs_destructor(struct bio *bio)
inline void bio_init(struct bio *bio)
{
bio->bi_next = NULL;
bio->bi_bdev = NULL;
bio->bi_flags = 1 << BIO_UPTODATE;
bio->bi_rw = 0;
bio->bi_vcnt = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册