提交 c2a9c7ab 编写于 作者: A Anand Jain 提交者: David Sterba

btrfs: check if the device is flush capable

The block layer call chain from submit_bio will check if the write cache
is enabled for the given queue before submitting the flush. This will
add a code to fail fast if its not.
Signed-off-by: NAnand Jain <anand.jain@oracle.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
[ updated changelog to reflect current code stat, blkdev_issue_flush is
  not used yet ]
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 13e88e15
......@@ -3518,9 +3518,13 @@ static void btrfs_end_empty_barrier(struct bio *bio)
*/
static int write_dev_flush(struct btrfs_device *device, int wait)
{
struct request_queue *q = bdev_get_queue(device->bdev);
struct bio *bio;
int ret = 0;
if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
return 0;
if (wait) {
bio = device->flush_bio;
if (!bio)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册