From e77eb62f253bc2288b1b4ff582f99ebf16a28c47 Mon Sep 17 00:00:00 2001 From: Basavanagowda Kanur Date: Thu, 16 Apr 2009 14:38:02 +0530 Subject: cluster/distribute bug fix - try to create linkfile in dht_lookup_everywhere_cbk(), only if hashed subvolume can be determined, else error out with ENOENT. -- with local fixes (avati) Signed-off-by: Anand V. Avati --- xlators/cluster/dht/src/dht-layout.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'xlators/cluster/dht/src/dht-layout.c') diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index d9824908a63..a49382f195d 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -591,3 +591,25 @@ out: return ret; } + +int +dht_layout_inode_set (xlator_t *this, xlator_t *subvol, inode_t *inode) +{ + dht_layout_t *layout = NULL; + int ret = -1; + + layout = dht_layout_for_subvol (this, subvol); + if (!layout) { + gf_log (this->name, GF_LOG_ERROR, + "no pre-set layout for subvolume %s", + subvol ? subvol->name : ""); + ret = -1; + goto out; + } + + inode_ctx_put (inode, this, (uint64_t)(long)layout); + + ret = 0; +out: + return ret; +} -- cgit