static ssize_t v9fs_synth_preadv(FsContext *ctx, V9fsFidOpenState *fs,

                                 const struct iovec *iov,

                                 int iovcnt, off_t offset)

{

    int i, count = 0, rcount;

    V9fsSynthOpenState *synth_open = fs->private;

    V9fsSynthNode *node = synth_open->node;

    if (!node->attr->read) {

        errno = EPERM;

        return -1;

    }

    for (i = 0; i < iovcnt; i++) {

        rcount = node->attr->read(iov[i].iov_base, iov[i].iov_len,

                                  offset, node->private);

        offset += rcount;

        count  += rcount;

        /* If we read less than requested. we are done */

        if (rcount < iov[i].iov_len) {

            break;

        }

    }

    return count;

}

static ssize_t v9fs_synth_preadv(FsContext *ctx, V9fsFidOpenState *fs,

                                 const struct iovec *iov,

                                 int iovcnt, off_t offset)

{

    int i, count = 0, rcount;

    V9fsSynthOpenState *synth_open = fs->private;

    V9fsSynthNode *node = synth_open->node;

    if (!node->attr->read) {

        errno = EPERM;

        return -1;

    }

    for (i = 0; i < iovcnt; i++) {

        rcount = node->attr->read(iov[i].iov_base, iov[i].iov_len,

                                  offset, node->private);

        offset += rcount;

        count  += rcount;

        

        if (rcount < iov[i].iov_len) {

            break;

        }

    }

    return count;

}

static ssize_t FUNC_0(FsContext *ctx, V9fsFidOpenState *fs,

                                 const struct iovec *iov,

                                 int iovcnt, off_t offset)

{

    int VAR_0, VAR_1 = 0, VAR_2;

    V9fsSynthOpenState *synth_open = fs->private;

    V9fsSynthNode *node = synth_open->node;

    if (!node->attr->read) {

        errno = EPERM;

        return -1;

    }

    for (VAR_0 = 0; VAR_0 < iovcnt; VAR_0++) {

        VAR_2 = node->attr->read(iov[VAR_0].iov_base, iov[VAR_0].iov_len,

                                  offset, node->private);

        offset += VAR_2;

        VAR_1  += VAR_2;

        

        if (VAR_2 < iov[VAR_0].iov_len) {

            break;

        }

    }

    return VAR_1;

}

static ssize_t FUNC_0(FsContext *ctx, V9fsFidOpenState *fs,
const struct iovec *iov,
int iovcnt, off_t offset)
{ int VAR_0, VAR_1 = 0, VAR_2; V9fsSynthOpenState *synth_open = fs->private; V9fsSynthNode *node = synth_open->node; if (!node->attr->read) { errno = EPERM; return -1; } for (VAR_0 = 0; VAR_0 < iovcnt; VAR_0++) { VAR_2 = node->attr->read(iov[VAR_0].iov_base, iov[VAR_0].iov_len,
offset, node->private); offset += VAR_2; VAR_1  += VAR_2; if (VAR_2 < iov[VAR_0].iov_len) { break; } } return VAR_1; }