anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone

Blame 0025-ndctl-scrub-Stop-translating-return-values.patch

Jeff Moyer 2c91dc
From c52109355b715bbe21e284090435bee7563863cc Mon Sep 17 00:00:00 2001
Jeff Moyer 2c91dc
From: Dan Williams <dan.j.williams@intel.com>
Jeff Moyer 2c91dc
Date: Wed, 26 May 2021 16:33:04 -0700
Jeff Moyer 2c91dc
Subject: [PATCH 025/217] ndctl/scrub: Stop translating return values
Bryan Gurney bc084d
Jeff Moyer 2c91dc
In preparation for triggering a poll loop within ndctl_bus_start_scrub(),
Jeff Moyer 2c91dc
stop translating return values into -EOPNOTSUPP.
Bryan Gurney bc084d
Jeff Moyer 2c91dc
Link: https://lore.kernel.org/r/162207198482.3715490.5994844104395495686.stgit@dwillia2-desk3.amr.corp.intel.com
Jeff Moyer 2c91dc
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Jeff Moyer 2c91dc
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Jeff Moyer 2c91dc
---
Jeff Moyer 2c91dc
 ndctl/lib/libndctl.c | 8 +-------
Jeff Moyer 2c91dc
 1 file changed, 1 insertion(+), 7 deletions(-)
Bryan Gurney bc084d
Bryan Gurney bc084d
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
Bryan Gurney bc084d
index aa36a3c..e5641fe 100644
Bryan Gurney bc084d
--- a/ndctl/lib/libndctl.c
Bryan Gurney bc084d
+++ b/ndctl/lib/libndctl.c
Bryan Gurney bc084d
@@ -1354,14 +1354,8 @@ static int __ndctl_bus_get_scrub_state(struct ndctl_bus *bus,
Bryan Gurney bc084d
 NDCTL_EXPORT int ndctl_bus_start_scrub(struct ndctl_bus *bus)
Bryan Gurney bc084d
 {
Bryan Gurney bc084d
 	struct ndctl_ctx *ctx = ndctl_bus_get_ctx(bus);
Bryan Gurney bc084d
-	int rc;
Bryan Gurney bc084d
 
Bryan Gurney bc084d
-	rc = sysfs_write_attr(ctx, bus->scrub_path, "1\n");
Bryan Gurney bc084d
-	if (rc == -EBUSY)
Bryan Gurney bc084d
-		return rc;
Bryan Gurney bc084d
-	else if (rc < 0)
Bryan Gurney bc084d
-		return -EOPNOTSUPP;
Bryan Gurney bc084d
-	return 0;
Bryan Gurney bc084d
+	return sysfs_write_attr(ctx, bus->scrub_path, "1\n");
Bryan Gurney bc084d
 }
Bryan Gurney bc084d
 
Bryan Gurney bc084d
 NDCTL_EXPORT int ndctl_bus_get_scrub_state(struct ndctl_bus *bus)
Jeff Moyer 2c91dc
-- 
Jeff Moyer 2c91dc
2.27.0
Jeff Moyer 2c91dc