tgtd doesn't affect semantics of caching, so we can always turn on
cache feature of sheepdog layer.

Signed-off-by: Hitoshi Mitake <mitake.hito...@lab.ntt.co.jp>
---
 usr/bs_sheepdog.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/usr/bs_sheepdog.c b/usr/bs_sheepdog.c
index 6d60bd6..a333675 100644
--- a/usr/bs_sheepdog.c
+++ b/usr/bs_sheepdog.c
@@ -795,13 +795,19 @@ retry:
                old_oid = 0;
 
                if (write) {
+                       /*
+                        * tgt doesn't affect semantics of caching, so we can
+                        * always turn on cache of sheep layer
+                        */
+                       flags = SD_FLAG_CMD_CACHE;
+
                        if (ai->inode.data_vdi_id[idx] != vid) {
                                create = 1;
 
                                if (ai->inode.data_vdi_id[idx]) {
                                        /* COW */
                                        old_oid = oid;
-                                       flags = SD_FLAG_CMD_COW;
+                                       flags |= SD_FLAG_CMD_COW;
                                }
 
                                oid = vid_to_data_oid(ai->inode.vdi_id, idx);
-- 
1.9.1

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to