diff options
author | Basavanagowda Kanur <gowda@gluster.com> | 2009-04-16 14:38:02 +0530 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-16 17:09:20 +0530 |
commit | e77eb62f253bc2288b1b4ff582f99ebf16a28c47 (patch) | |
tree | e5e1b4c9a1277822850808595bd0509398730116 /xlators/cluster/dht/src/dht-layout.c | |
parent | d1703344735d9c4df89b84310deaf1b9703f8c49 (diff) |
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 <avati@amp.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-layout.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-layout.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index d9824908a..a49382f19 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 : "<nil>"); + ret = -1; + goto out; + } + + inode_ctx_put (inode, this, (uint64_t)(long)layout); + + ret = 0; +out: + return ret; +} |