diff options
author | Christoph Hellwig <hch@lst.de> | 2022-11-09 11:10:37 +0100 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2022-11-14 19:15:35 +0100 |
commit | ad831a16b08c3f1a1f28a56d2054313d7d521da9 (patch) | |
tree | 8d80098ba5c9a78431379cd31d96681d3fc7fa68 /drivers/md/raid5-cache.c | |
parent | md: fix a crash in mempool_free (diff) | |
download | linux-ad831a16b08c3f1a1f28a56d2054313d7d521da9.tar.xz linux-ad831a16b08c3f1a1f28a56d2054313d7d521da9.zip |
md/raid5: use bdev_write_cache instead of open coding it
Use the bdev_write_cache instead of two equivalent open coded checks.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r-- | drivers/md/raid5-cache.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index a63023aae21e..46182b955aef 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -3062,7 +3062,6 @@ void r5c_update_on_rdev_error(struct mddev *mddev, struct md_rdev *rdev) int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev) { - struct request_queue *q = bdev_get_queue(rdev->bdev); struct r5l_log *log; int ret; @@ -3091,9 +3090,7 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev) if (!log) return -ENOMEM; log->rdev = rdev; - - log->need_cache_flush = test_bit(QUEUE_FLAG_WC, &q->queue_flags) != 0; - + log->need_cache_flush = bdev_write_cache(rdev->bdev); log->uuid_checksum = crc32c_le(~0, rdev->mddev->uuid, sizeof(rdev->mddev->uuid)); |