[stgt] [PATCH 4/7] change return value of dtd_check_removable() to tgtadm_err, update use cases

nezhinsky at gmail.com nezhinsky at gmail.com
Fri May 18 12:24:26 CEST 2012


From: Alexander Nezhinsky <alexandern at mellanox.com>


Signed-off-by: Alexander Nezhinsky <alexandern at mellanox.com>
---
 usr/smc.c    |    3 ++-
 usr/target.c |    4 ++--
 usr/tgtd.h   |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/usr/smc.c b/usr/smc.c
index f327f14..0034d0e 100644
--- a/usr/smc.c
+++ b/usr/smc.c
@@ -50,7 +50,8 @@
 
 static int check_slot_removable(struct slot *s)
 {
-	return dtd_check_removable(s->drive_tid, s->drive_lun);
+	tgtadm_err adm_err = dtd_check_removable(s->drive_tid, s->drive_lun);
+	return (adm_err == TGTADM_SUCCESS ? 0 : -EINVAL);
 }
 
 static int set_slot_full(struct slot *s, uint16_t src, char *path)
diff --git a/usr/target.c b/usr/target.c
index 542d4b5..95af706 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -760,9 +760,9 @@ struct lu_phy_attr *lu_attr_lookup(int tid, uint64_t lun)
  * @tid:	Target ID
  * @lun:	LUN
  *
- * check if a DT can have its media reoved or not
+ * check if a DT can have its media removed or not
  */
-int dtd_check_removable(int tid, uint64_t lun)
+tgtadm_err dtd_check_removable(int tid, uint64_t lun)
 {
 	struct scsi_lu *lu;
 
diff --git a/usr/tgtd.h b/usr/tgtd.h
index d93fa1a..04c5ed4 100644
--- a/usr/tgtd.h
+++ b/usr/tgtd.h
@@ -325,7 +325,7 @@ extern int device_type_register(struct device_type_template *);
 
 extern struct lu_phy_attr *lu_attr_lookup(int tid, uint64_t lun);
 extern tgtadm_err dtd_load_unload(int tid, uint64_t lun, int load, char *file);
-extern int dtd_check_removable(int tid, uint64_t lun);
+extern tgtadm_err dtd_check_removable(int tid, uint64_t lun);
 
 extern int register_backingstore_template(struct backingstore_template *bst);
 extern struct backingstore_template *get_backingstore_template(const char *name);
-- 
1.7.9.6

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list