Skip to contentSkip to conversation

chunkd: Add tchdbsetmutex

PATCH Applied Pete Zaitcev 1 participant 1 message Dec 26, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 chunkd: Add tchdbsetmutex

Documentation says this is necessary for multi-threaded access.

---
 server/be-fs.c |    3 +++
 1 file changed, 3 insertions(+)

commit 8245bc23aa4608a666b8dda767f18ca03a110906

Author: Master <[email protected]>
Date:   Fri Dec 25 22:14:37 2009 -0700

Enable multi-threaded access.

server/be-fs.c +3 -0
index 908d41e..89635f8 100644
@@ -74,6 +74,9 @@ int fs_open(void)
 		goto out;
 	}
 
+	if (!tchdbsetmutex(hdb))
+		goto out_hdb;
+
 	omode = HDBOREADER | HDBONOLCK | HDBOWRITER | HDBOCREAT | HDBOTSYNC;
 	if (!tchdbopen(hdb, db_fn, omode)) {
 		applog(LOG_ERR, "failed to open master table %s", db_fn);