[stgt] [PATCH 2/3] sheepdog: set flag for indicating requests are from tgt

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Sep 26 08:44:25 CEST 2014


It is required for iSCSI multipath with sheepdog.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 usr/bs_sheepdog.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/usr/bs_sheepdog.c b/usr/bs_sheepdog.c
index 09ba470..06f2995 100644
--- a/usr/bs_sheepdog.c
+++ b/usr/bs_sheepdog.c
@@ -66,6 +66,9 @@
 #define SD_FLAG_CMD_COW      0x02
 #define SD_FLAG_CMD_CACHE    0x04 /* Writeback mode for cache */
 #define SD_FLAG_CMD_DIRECT   0x08 /* Don't use cache */
+/* return something back while sending something to sheep */
+#define SD_FLAG_CMD_PIGGYBACK   0x10
+#define SD_FLAG_CMD_TGT   0x20
 
 #define SD_RES_SUCCESS       0x00 /* Success */
 #define SD_RES_UNKNOWN       0x01 /* Unknown error */
@@ -693,6 +696,7 @@ static int read_write_object(struct sheepdog_access_info *ai, char *buf,
 	hdr.data_length = datalen;
 	hdr.offset = offset;
 	hdr.copies = copies;
+	hdr.flags |= SD_FLAG_CMD_TGT;
 
 	ret = do_req(ai, (struct sheepdog_req *)&hdr, buf, &wlen, &rlen);
 	if (ret) {
@@ -1171,6 +1175,7 @@ trans_to_expect_nothing:
 	ai->min_dirty_data_idx = UINT32_MAX;
 	ai->max_dirty_data_idx = 0;
 
+retry:
 	ret = read_object(ai, (char *)&ai->inode, vid_to_vdi_oid(vid),
 			  0, SD_INODE_SIZE, 0, &need_reload);
 	if (ret)
-- 
1.8.3.2

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