From 43620138726da124f5eb58c9347cba8b582271ed Mon Sep 17 00:00:00 2001 From: David Teigland Date: Fri, 11 May 2018 09:50:25 -0500 Subject: [PATCH] bcache: disable fallback to old io All io has been converted to bcache. --- lib/label/label.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/lib/label/label.c b/lib/label/label.c index f5f30c62d..45acd7397 100644 --- a/lib/label/label.c +++ b/lib/label/label.c @@ -978,15 +978,9 @@ bool dev_read_bytes(struct device *dev, uint64_t start, size_t len, void *data) int ret; if (!scan_bcache) { - if (!dev_open_readonly(dev)) - return false; - - ret = dev_read(dev, start, len, 0, data); - - if (!dev_close(dev)) - stack; - - return ret ? true : false; + /* Should not happen */ + log_error("dev_read bcache not set up %s", dev_name(dev)); + return false; } if (dev->bcache_fd <= 0) { @@ -1015,15 +1009,9 @@ bool dev_write_bytes(struct device *dev, uint64_t start, size_t len, void *data) return true; if (!scan_bcache) { - if (!dev_open(dev)) - return false; - - ret = dev_write(dev, start, len, 0, data); - - if (!dev_close(dev)) - stack; - - return ret ? true : false; + /* Should not happen */ + log_error("dev_write bcache not set up %s", dev_name(dev)); + return false; } if (dev->bcache_fd <= 0) { @@ -1056,7 +1044,7 @@ bool dev_write_zeros(struct device *dev, uint64_t start, size_t len) return true; if (!scan_bcache) { - log_error("dev_write_zeros %s bcache not set up", dev_name(dev)); + log_error("dev_write_zeros bcache not set up %s", dev_name(dev)); return false; } @@ -1090,7 +1078,7 @@ bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val) return true; if (!scan_bcache) { - log_error("dev_set_bytes %s bcache not set up", dev_name(dev)); + log_error("dev_set_bytes bcache not set up %s", dev_name(dev)); return false; } -- 2.43.5