summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts/create/post/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
} if (is_linkfile) { subvol = dht_linkfile_subvol(this, inode, stbuf, xattr); if (!subvol) { gf_msg_debug(this->name, 0, "linkfile has no link subvolume.path=%s", loc->path); dht_lookup_everywhere(frame, this, loc); return 0; } STACK_WIND_COOKIE(frame, dht_lookup_linkfile_cbk, subvol, subvol, subvol->fops->lookup, &local->loc, local->xattr_req); } return 0; out: if (!local->hashed_subvol) { gf_msg_debug(this->name, 0, "no subvolume in layout for path=%s", local->loc.path); local->op_errno = ENOENT; dht_lookup_everywhere(frame, this, loc); return 0; } STACK_WIND_COOKIE(frame, dht_lookup_cbk, local->hashed_subvol, local->hashed_subvol, local->hashed_subvol->fops->lookup, &local->loc, local->xattr_req); return 0; err: DHT_STACK_UNWIND(lookup, frame, op_ret, op_errno, inode, stbuf, xattr, NULL); return 0; } int switch_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) { xlator_t *hashed_subvol = NULL; xlator_t *cached_subvol = NULL; xlator_t *subvol = NULL; dht_local_t *local = NULL; dht_conf_t *conf = NULL; int ret = -1; int op_errno = -1; dht_layout_t *layout = NULL; int i = 0; int call_cnt = 0; VALIDATE_OR_GOTO(frame, err); VALIDATE_OR_GOTO(this, err); VALIDATE_OR_GOTO(loc, err); VALIDATE_OR_GOTO(loc->inode, err); VALIDATE_OR_GOTO(loc->path, err); conf = this->private; local = dht_local_init(frame, loc, NULL, GF_FOP_LOOKUP); if (!local) { op_errno = ENOMEM; goto err; } if (xattr_req) { local->xattr_req = dict_ref(xattr_req); } else { local->xattr_req = dict_new(); } hashed_subvol = dht_subvol_get_hashed(this, &local->loc); cached_subvol = local->cached_subvol; local->hashed_subvol = hashed_subvol; if (is_revalidate(loc)) { layout = local->layout; if (!layout) { gf_msg_debug(this->name, 0, "revalidate lookup without cache. path=%s", loc->path); op_errno = EINVAL; goto err; } if (layout->gen && (layout->gen < conf->gen)) { gf_msg_debug(this->name, 0, "incomplete layout failure for path=%s", loc->path); dht_layout_unref(this, local->layout); goto do_fresh_lookup; } local->inode = inode_ref(loc->inode); local->call_cnt = layout->cnt; call_cnt = local->call_cnt; /* NOTE: we don't require 'trusted.glusterfs.dht.linkto' * attribute, revalidates directly go to the cached-subvolume. */ ret = dict_set_uint32(local->xattr_req, conf->xattr_name, 4 * 4); if (ret < 0) gf_msg(this->name, GF_LOG_WARNING, 0, DHT_MSG_DICT_SET_FAILED, "failed to set dict value for %s", conf->xattr_na