#define LOCKED_YES 0x1 /* for DATA, METADATA, ENTRY and higher_path of RENAME */ #define LOCKED_LOWER 0x2 /* for lower_path of RENAME */ afr_fd_ctx_t * __afr_fd_ctx_get (fd_t *fd, xlator_t *this) { uint64_t ctx = 0; int ret = 0; afr_fd_ctx_t *fd_ctx = NULL; int i = 0; afr_private_t *priv = NULL; priv = this->private; ret = __fd_ctx_get (fd, this, &ctx); if (ret < 0 && fd_is_anonymous (fd)) { ret = __afr_fd_ctx_set (this, fd); if (ret < 0) goto out; ret = __fd_ctx_get (fd, this, &ctx); if (ret < 0) goto out; fd_ctx = (afr_fd_ctx_t *)(long) ctx; for (i = 0; i < priv->child_count; i++) fd_ctx->opened_on[i] = AFR_FD_OPENED; }
loc_t loc; dict_t *xdata; int flags; int op_errno; struct list_head list; } ob_fd_t; ob_fd_t * __ob_fd_ctx_get (xlator_t *this, fd_t *fd) { uint64_t value = 0; int ret = -1; ob_fd_t *ob_fd = NULL; ret = __fd_ctx_get (fd, this, &value); if (ret) return NULL; ob_fd = (void *) ((long) value); return ob_fd; } ob_fd_t * ob_fd_ctx_get (xlator_t *this, fd_t *fd) { ob_fd_t *ob_fd = NULL; LOCK (&fd->lock);