[sheepdog] [PATCH] sheep: enable disk cache when creating objects

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Oct 11 21:35:28 CEST 2012


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/plain_store.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index 640c240..995f7d4 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -302,6 +302,9 @@ int default_create_and_write(uint64_t oid, struct siocb *iocb)
 	get_obj_path(oid, path);
 	get_tmp_obj_path(oid, tmp_path);
 
+	if (iocb->flags & SD_FLAG_CMD_CACHE && is_disk_cache_enabled())
+		flags &= ~O_DSYNC;
+
 	fd = open(tmp_path, flags, def_fmode);
 	if (fd < 0) {
 		if (errno == EEXIST)
-- 
1.7.2.5




More information about the sheepdog mailing list