int v9fs_co_open2(V9fsState *s, V9fsFidState *fidp, char *fullname, gid_t gid,

                  int flags, int mode)

{

    int err;

    FsCred cred;



    cred_init(&cred);

    cred.fc_mode = mode & 07777;

    cred.fc_uid = fidp->uid;

    cred.fc_gid = gid;

    v9fs_co_run_in_worker(

        {

            fidp->fs.fd = s->ops->open2(&s->ctx, fullname, flags, &cred);

            err = 0;

            if (fidp->fs.fd == -1) {

                err = -errno;

            }

        });

    if (!err) {

        total_open_fd++;

        if (total_open_fd > open_fd_hw) {

            v9fs_reclaim_fd(s);

        }

    }

    return err;

}

int v9fs_co_open2(V9fsState *s, V9fsFidState *fidp, char *fullname, gid_t gid,

                  int flags, int mode)

{

    int err;

    FsCred cred;



    cred_init(&cred);

    cred.fc_mode = mode & 07777;

    cred.fc_uid = fidp->uid;

    cred.fc_gid = gid;

    v9fs_co_run_in_worker(

        {

            fidp->fs.fd = s->ops->open2(&s->ctx, fullname, flags, &cred);

            err = 0;

            if (fidp->fs.fd == -1) {

                err = -errno;

            }

        });

    if (!err) {

        total_open_fd++;

        if (total_open_fd > open_fd_hw) {

            v9fs_reclaim_fd(s);

        }

    }

    return err;

}

int FUNC_0(V9fsState *VAR_0, V9fsFidState *VAR_1, char *VAR_2, gid_t VAR_3,

                  int VAR_4, int VAR_5)

{

    int VAR_6;

    FsCred cred;



    cred_init(&cred);

    cred.fc_mode = VAR_5 & 07777;

    cred.fc_uid = VAR_1->uid;

    cred.fc_gid = VAR_3;

    v9fs_co_run_in_worker(

        {

            VAR_1->fs.fd = VAR_0->ops->open2(&VAR_0->ctx, VAR_2, VAR_4, &cred);

            VAR_6 = 0;

            if (VAR_1->fs.fd == -1) {

                VAR_6 = -errno;

            }

        });

    if (!VAR_6) {

        total_open_fd++;

        if (total_open_fd > open_fd_hw) {

            v9fs_reclaim_fd(VAR_0);

        }

    }

    return VAR_6;

}

int FUNC_0(V9fsState *VAR_0, V9fsFidState *VAR_1, char *VAR_2, gid_t VAR_3,
int VAR_4, int VAR_5)
{ int VAR_6; FsCred cred; cred_init(&cred); cred.fc_mode = VAR_5 & 07777; cred.fc_uid = VAR_1->uid; cred.fc_gid = VAR_3; v9fs_co_run_in_worker(
{ VAR_1->fs.fd = VAR_0->ops->open2(&VAR_0->ctx, VAR_2, VAR_4, &cred); VAR_6 = 0; if (VAR_1->fs.fd == -1) { VAR_6 = -errno; } }); if (!VAR_6) { total_open_fd++; if (total_open_fd > open_fd_hw) { v9fs_reclaim_fd(VAR_0); } } return VAR_6; }