diff options
Diffstat (limited to 'xlators/performance/quick-read/src/quick-read.c')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 7db1e686f7d..6c9a0f0e5b5 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -82,47 +82,25 @@ static int32_t qr_loc_fill (loc_t *loc, inode_t *inode, char *path) { int32_t ret = -1; - char *parent = NULL; - char *path_copy = NULL; GF_VALIDATE_OR_GOTO_WITH_ERROR ("quick-read", loc, out, errno, EINVAL); GF_VALIDATE_OR_GOTO_WITH_ERROR ("quick-read", inode, out, errno, EINVAL); GF_VALIDATE_OR_GOTO_WITH_ERROR ("quick-read", path, out, errno, EINVAL); - GF_VALIDATE_OR_GOTO_WITH_ERROR ("quick-read", inode->table, out, errno, - EINVAL); loc->inode = inode_ref (inode); - loc->path = gf_strdup (path); - - path_copy = gf_strdup (path); - if (path_copy == NULL) { - ret = -1; - goto out; - } + uuid_copy (loc->gfid, inode->gfid); - parent = dirname (path_copy); - - loc->parent = inode_from_path (inode->table, parent); - if (loc->parent == NULL) { - ret = -1; - errno = EINVAL; - gf_log ("quick-read", GF_LOG_WARNING, - "cannot search parent inode for path (%s)", path); + loc->path = gf_strdup (path); + if (!loc->path) goto out; - } - loc->name = strrchr (loc->path, '/'); ret = 0; out: if (ret == -1) { qr_loc_wipe (loc); } - if (path_copy) { - GF_FREE (path_copy); - } - return ret; } |