diff options
Diffstat (limited to 'xlators/features/gfid-access/src')
| -rw-r--r-- | xlators/features/gfid-access/src/gfid-access.c | 7 | ||||
| -rw-r--r-- | xlators/features/gfid-access/src/gfid-access.h | 9 | 
2 files changed, 9 insertions, 7 deletions
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index 5be60bfa913..040d530cb19 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -96,7 +96,6 @@ ga_newfile_parse_args (xlator_t *this, data_t *data)          blob_len -= sizeof (uint32_t);          len = strnlen (blob, blob_len); -        if (len == blob_len)          if (len == blob_len) {                  gf_log (this->name, GF_LOG_ERROR,                          "gfid: %s. No null byte present.", @@ -277,7 +276,11 @@ ga_fill_tmp_loc (loc_t *loc, xlator_t *this, uuid_t gfid,                  new_loc->inode = inode_new (parent->table);          loc_path (new_loc, bname); -        new_loc->name = basename (new_loc->path); +        if (new_loc->path) { +                new_loc->name = strrchr (new_loc->path, '/'); +                if (new_loc->name) +                        new_loc->name++; +        }          gfid_ptr = GF_CALLOC (1, sizeof(uuid_t), gf_common_mt_uuid_t);          if (!gfid_ptr) { diff --git a/xlators/features/gfid-access/src/gfid-access.h b/xlators/features/gfid-access/src/gfid-access.h index e883eca696c..9bc4d2dfd2d 100644 --- a/xlators/features/gfid-access/src/gfid-access.h +++ b/xlators/features/gfid-access/src/gfid-access.h @@ -34,7 +34,6 @@  #define GFID_ACCESS_GET_VALID_DIR_INODE(x,l,unref,lbl) do {             \                  int       ret       = 0;                                \                  uint64_t  value     = 0;                                \ -                inode_t  *tmp_inode = NULL;                             \                                                                          \                  /* if its an entry operation, on the virtual */         \                  /* directory inode as parent, we need to handle */      \ @@ -43,8 +42,8 @@                          ret = inode_ctx_get (l->parent, x, &value);     \                          if (ret)                                        \                                  goto lbl;                               \ -                        tmp_inode = (inode_t *)value;                   \ -                        l->parent = inode_ref (tmp_inode);                          \ +                        unref = (inode_t *)value;                       \ +                        l->parent = inode_ref (unref);                  \                          /* if parent is virtual, no need to handle */   \                          /* loc->inode */                                \                          break;                                          \ @@ -57,8 +56,8 @@                          ret = inode_ctx_get (l->inode, x, &value);      \                          if (ret)                                        \                                  goto lbl;                               \ -                        tmp_inode = (inode_t *)value;                   \ -                        l->inode = inode_ref (tmp_inode);                           \ +                        unref = (inode_t *)value;                       \ +                        l->inode = inode_ref (unref);                   \                  }                                                       \                                                                          \          } while (0)  | 
