Example #1
0
    int i                     = 0;
    int ret                   = 0;
    quota_meta_t size         = {0, };
    quota_meta_t max_size     = {0, };
    int readable_cnt          = 0;
    int read_subvol           = -1;

    local = frame->local;
    priv = this->private;
    replies = local->replies;

    readable = alloca0 (priv->child_count);

    afr_inode_read_subvol_get (local->inode, this, readable, 0, 0);

    readable_cnt = AFR_COUNT (readable, priv->child_count);

    for (i = 0; i < priv->child_count; i++) {
        if (!replies[i].valid || replies[i].op_ret == -1)
            continue;
        if (readable_cnt && !readable[i])
            continue;
        if (!replies[i].xdata)
            continue;
        ret = quota_dict_get_meta (replies[i].xdata, QUOTA_SIZE_KEY,
                                   &size);
        if (ret == -1)
            continue;
        if (read_subvol == -1)
            read_subvol = i;
        if (size.size > max_size.size ||
Example #2
0
afr_changelog_do (call_frame_t *frame, xlator_t *this, dict_t *xattr,
		  afr_changelog_resume_t changelog_resume);


int
__afr_txn_write_fop (call_frame_t *frame, xlator_t *this)
{
        afr_local_t *local = NULL;
        afr_private_t *priv = NULL;
        int call_count = -1;
        int i = 0;

        local = frame->local;
        priv = this->private;

        call_count = AFR_COUNT (local->transaction.pre_op, priv->child_count);

        if (call_count == 0) {
                local->transaction.resume (frame, this);
                return 0;
        }

        local->call_count = call_count;

        for (i = 0; i < priv->child_count; i++) {
                if (local->transaction.pre_op[i]) {
			local->transaction.wind (frame, this, i);

                        if (!--call_count)
                                break;
                }