summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-08-23 22:37:26 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 01:43:08 -0700
commitef073ee5430e1f3af3bd580dd99a72352889756b (patch)
tree497946d5eca316587f8ebfc45c2e630f3e27a330 /xlators/performance
parent6bf11bf0dee3d3e70536a96cb8f8a4b01c26b445 (diff)
performance/stat-prefetch: minor bug-fixes.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 4a25c8e45db..73dad13d6f7 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -41,8 +41,10 @@ sp_cache_init (void)
void
sp_local_free (sp_local_t *local)
{
- loc_wipe (&local->loc);
- FREE (local);
+ if (local) {
+ loc_wipe (&local->loc);
+ FREE (local);
+ }
}
@@ -51,7 +53,6 @@ sp_cache_remove_entry (sp_cache_t *cache, char *name, char remove_all)
{
int32_t ret = -1;
gf_dirent_t *entry = NULL, *tmp = NULL;
- char found = 0;
if ((cache == NULL) || ((name == NULL) && !remove_all)) {
goto out;
@@ -63,7 +64,7 @@ sp_cache_remove_entry (sp_cache_t *cache, char *name, char remove_all)
list) {
if (remove_all || (!strcmp (name, entry->d_name))) {
list_del_init (&entry->list);
- found = 1;
+ FREE (entry);
ret = 0;
if (!remove_all) {
@@ -74,9 +75,6 @@ sp_cache_remove_entry (sp_cache_t *cache, char *name, char remove_all)
}
UNLOCK (&cache->lock);
- if (found) {
- FREE (entry);
- }
out:
return ret;
}
@@ -461,6 +459,8 @@ sp_get_ancestors (char *path, char **parent, char **grand_parent)
break;
}
}
+
+ ret = 0;
out:
return ret;
}
@@ -525,11 +525,11 @@ sp_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req)
call_frame_t *wind_frame = NULL;
char lookup_behind = 0;
- if ((loc == NULL) || (loc->parent == NULL) || (loc->name == NULL)) {
+ if (loc == NULL) {
goto unwind;
}
- if (xattr_req) {
+ if (xattr_req || (loc->parent == NULL) || (loc->name == NULL)) {
goto wind;
}