[stgt] [PATCH 1/2] add PREVENT ALLOW MEDIA REMOVAL support

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed Aug 27 16:28:55 CEST 2008


It's NO-OP for now.

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 usr/spc.c |   10 ++++++++++
 usr/spc.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index bd2c975..60fd7d7 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -318,6 +318,16 @@ int spc_test_unit(int host_no, struct scsi_cmd *cmd)
 	return SAM_STAT_CHECK_CONDITION;
 }
 
+int spc_prevent_allow_media_removal(int host_no, struct scsi_cmd *cmd)
+{
+	/* TODO: implement properly */
+
+	if (device_reserved(cmd))
+		return SAM_STAT_RESERVATION_CONFLICT;
+	else
+		return SAM_STAT_GOOD;
+}
+
 int spc_mode_select(int host_no, struct scsi_cmd *cmd,
 		    int (*update)(struct scsi_cmd *, uint8_t *, int *))
 {
diff --git a/usr/spc.h b/usr/spc.h
index 8fe3e3c..cfc9cf3 100644
--- a/usr/spc.h
+++ b/usr/spc.h
@@ -8,6 +8,7 @@ extern int spc_report_luns(int host_no, struct scsi_cmd *cmd);
 extern int spc_start_stop(int host_no, struct scsi_cmd *cmd);
 extern int spc_test_unit(int host_no, struct scsi_cmd *cmd);
 extern int spc_request_sense(int host_no, struct scsi_cmd *cmd);
+extern int spc_prevent_allow_media_removal(int host_no, struct scsi_cmd *cmd);
 extern int spc_illegal_op(int host_no, struct scsi_cmd *cmd);
 extern int spc_lu_init(struct scsi_lu *lu);
 
-- 
1.5.5.GIT

--
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