static void v9fs_remove(void *opaque)

{

    int32_t fid;

    int err = 0;

    size_t offset = 7;

    V9fsFidState *fidp;

    V9fsPDU *pdu = opaque;



    pdu_unmarshal(pdu, offset, "d", &fid);




    fidp = get_fid(pdu, fid);

    if (fidp == NULL) {

        err = -EINVAL;

        goto out_nofid;

    }

    /* if fs driver is not path based, return EOPNOTSUPP */

    if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) {

        err = -EOPNOTSUPP;

        goto out_err;

    }

    /*

     * IF the file is unlinked, we cannot reopen

     * the file later. So don't reclaim fd

     */

    err = v9fs_mark_fids_unreclaim(pdu, &fidp->path);

    if (err < 0) {

        goto out_err;

    }

    err = v9fs_co_remove(pdu, &fidp->path);

    if (!err) {

        err = offset;

    }

out_err:

    /* For TREMOVE we need to clunk the fid even on failed remove */

    clunk_fid(pdu->s, fidp->fid);

    put_fid(pdu, fidp);

out_nofid:

    complete_pdu(pdu->s, pdu, err);

}
static void v9fs_remove(void *opaque)

{

    int32_t fid;

    int err = 0;

    size_t offset = 7;

    V9fsFidState *fidp;

    V9fsPDU *pdu = opaque;



    pdu_unmarshal(pdu, offset, "d", &fid);




    fidp = get_fid(pdu, fid);

    if (fidp == NULL) {

        err = -EINVAL;

        goto out_nofid;

    }

    

    if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) {

        err = -EOPNOTSUPP;

        goto out_err;

    }

    







    err = v9fs_mark_fids_unreclaim(pdu, &fidp->path);

    if (err < 0) {

        goto out_err;

    }

    err = v9fs_co_remove(pdu, &fidp->path);

    if (!err) {

        err = offset;

    }

out_err:

    

    clunk_fid(pdu->s, fidp->fid);

    put_fid(pdu, fidp);

out_nofid:

    complete_pdu(pdu->s, pdu, err);

}
static void FUNC_0(void *VAR_0)

{

    int32_t fid;

    int VAR_1 = 0;

    size_t offset = 7;

    V9fsFidState *fidp;

    V9fsPDU *pdu = VAR_0;



    pdu_unmarshal(pdu, offset, "d", &fid);




    fidp = get_fid(pdu, fid);

    if (fidp == NULL) {

        VAR_1 = -EINVAL;

        goto out_nofid;

    }

    

    if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) {

        VAR_1 = -EOPNOTSUPP;

        goto out_err;

    }

    







    VAR_1 = v9fs_mark_fids_unreclaim(pdu, &fidp->path);

    if (VAR_1 < 0) {

        goto out_err;

    }

    VAR_1 = v9fs_co_remove(pdu, &fidp->path);

    if (!VAR_1) {

        VAR_1 = offset;

    }

out_err:

    

    clunk_fid(pdu->s, fidp->fid);

    put_fid(pdu, fidp);

out_nofid:

    complete_pdu(pdu->s, pdu, VAR_1);

}
static void FUNC_0(void *VAR_0)
{ int32_t fid; int VAR_1 = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = VAR_0; pdu_unmarshal(pdu, offset, "d", &fid); fidp = get_fid(pdu, fid); if (fidp == NULL) { VAR_1 = -EINVAL; goto out_nofid; } if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) { VAR_1 = -EOPNOTSUPP; goto out_err; } VAR_1 = v9fs_mark_fids_unreclaim(pdu, &fidp->path); if (VAR_1 < 0) { goto out_err; } VAR_1 = v9fs_co_remove(pdu, &fidp->path); if (!VAR_1) { VAR_1 = offset; } out_err:
clunk_fid(pdu->s, fidp->fid); put_fid(pdu, fidp); out_nofid:
complete_pdu(pdu->s, pdu, VAR_1); }