diff options
Diffstat (limited to 'xlators/cluster/ec/src/ec-heald.c')
-rw-r--r-- | xlators/cluster/ec/src/ec-heald.c | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c index c87f328db0f..9860f10eadd 100644 --- a/xlators/cluster/ec/src/ec-heald.c +++ b/xlators/cluster/ec/src/ec-heald.c @@ -126,42 +126,6 @@ unlock: return ret; } - -int -ec_shd_inode_find (xlator_t *this, xlator_t *subvol, - uuid_t gfid, inode_t **inode) -{ - int ret = 0; - loc_t loc = {0, }; - struct iatt iatt = {0, }; - *inode = NULL; - - *inode = inode_find (this->itable, gfid); - if (*inode) - goto out; - - loc.inode = inode_new (this->itable); - if (!loc.inode) { - ret = -ENOMEM; - goto out; - } - gf_uuid_copy (loc.gfid, gfid); - - ret = syncop_lookup (subvol, &loc, &iatt, NULL, NULL, NULL); - if (ret < 0) - goto out; - - *inode = inode_link (loc.inode, NULL, NULL, &iatt); - if (!*inode) { - ret = -ENOMEM; - goto out; - } -out: - loc_wipe (&loc); - return ret; -} - - int ec_shd_index_inode (xlator_t *this, xlator_t *subvol, inode_t **inode) { @@ -190,7 +154,8 @@ ec_shd_index_inode (xlator_t *this, xlator_t *subvol, inode_t **inode) gf_msg_debug (this->name, 0, "index-dir gfid for %s: %s", subvol->name, uuid_utoa (index_gfid)); - ret = ec_shd_inode_find (this, subvol, index_gfid, inode); + ret = syncop_inode_find (this, subvol, index_gfid, + inode, NULL, NULL); out: loc_wipe (&rootloc); @@ -250,8 +215,8 @@ ec_shd_index_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent, if (ret < 0) goto out; - ret = ec_shd_inode_find (healer->this, healer->this, loc.gfid, - &loc.inode); + ret = syncop_inode_find (healer->this, healer->this, loc.gfid, + &loc.inode, NULL, NULL); if (ret < 0) goto out; @@ -329,7 +294,8 @@ ec_shd_full_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent, if (ret < 0) goto out; - ret = ec_shd_inode_find (this, this, loc.gfid, &loc.inode); + ret = syncop_inode_find (this, this, loc.gfid, + &loc.inode, NULL, NULL); if (ret < 0) goto out; |