static void v9fs_unlinkat(void *opaque)
{
    int err = 0;
    V9fsString name;
    int32_t dfid, flags;
    size_t offset = 7;
    V9fsPath path;
    V9fsFidState *dfidp;
    V9fsPDU *pdu = opaque;
    v9fs_string_init(&name);
    err = pdu_unmarshal(pdu, offset, "dsd", &dfid, &name, &flags);
    if (err < 0) {
    dfidp = get_fid(pdu, dfid);
    if (dfidp == NULL) {
        err = -EINVAL;
    /*
     * IF the file is unlinked, we cannot reopen
     * the file later. So don't reclaim fd
     */
    v9fs_path_init(&path);
    err = v9fs_co_name_to_path(pdu, &dfidp->path, name.data, &path);
    if (err < 0) {
        goto out_err;
    err = v9fs_mark_fids_unreclaim(pdu, &path);
    if (err < 0) {
        goto out_err;
    err = v9fs_co_unlinkat(pdu, &dfidp->path, &name, flags);
    if (!err) {
        err = offset;
out_err:
    put_fid(pdu, dfidp);
    v9fs_path_free(&path);
out_nofid:
    pdu_complete(pdu, err);
    v9fs_string_free(&name);
static void v9fs_unlinkat(void *opaque)
{
    int err = 0;
    V9fsString name;
    int32_t dfid, flags;
    size_t offset = 7;
    V9fsPath path;
    V9fsFidState *dfidp;
    V9fsPDU *pdu = opaque;
    v9fs_string_init(&name);
    err = pdu_unmarshal(pdu, offset, "dsd", &dfid, &name, &flags);
    if (err < 0) {
    dfidp = get_fid(pdu, dfid);
    if (dfidp == NULL) {
        err = -EINVAL;
    



    v9fs_path_init(&path);
    err = v9fs_co_name_to_path(pdu, &dfidp->path, name.data, &path);
    if (err < 0) {
        goto out_err;
    err = v9fs_mark_fids_unreclaim(pdu, &path);
    if (err < 0) {
        goto out_err;
    err = v9fs_co_unlinkat(pdu, &dfidp->path, &name, flags);
    if (!err) {
        err = offset;
out_err:
    put_fid(pdu, dfidp);
    v9fs_path_free(&path);
out_nofid:
    pdu_complete(pdu, err);
    v9fs_string_free(&name);
static void FUNC_0(void *VAR_0)
{
    int VAR_1 = 0;
    V9fsString name;
    int32_t dfid, flags;
    size_t offset = 7;
    V9fsPath path;
    V9fsFidState *dfidp;
    V9fsPDU *pdu = VAR_0;
    v9fs_string_init(&name);
    VAR_1 = pdu_unmarshal(pdu, offset, "dsd", &dfid, &name, &flags);
    if (VAR_1 < 0) {
    dfidp = get_fid(pdu, dfid);
    if (dfidp == NULL) {
        VAR_1 = -EINVAL;
    



    v9fs_path_init(&path);
    VAR_1 = v9fs_co_name_to_path(pdu, &dfidp->path, name.data, &path);
    if (VAR_1 < 0) {
        goto out_err;
    VAR_1 = v9fs_mark_fids_unreclaim(pdu, &path);
    if (VAR_1 < 0) {
        goto out_err;
    VAR_1 = v9fs_co_unlinkat(pdu, &dfidp->path, &name, flags);
    if (!VAR_1) {
        VAR_1 = offset;
out_err:
    put_fid(pdu, dfidp);
    v9fs_path_free(&path);
out_nofid:
    pdu_complete(pdu, VAR_1);
    v9fs_string_free(&name);
static void FUNC_0(void *VAR_0)
{ int VAR_1 = 0; V9fsString name; int32_t dfid, flags; size_t offset = 7; V9fsPath path; V9fsFidState *dfidp; V9fsPDU *pdu = VAR_0; v9fs_string_init(&name); VAR_1 = pdu_unmarshal(pdu, offset, "dsd", &dfid, &name, &flags); if (VAR_1 < 0) { dfidp = get_fid(pdu, dfid); if (dfidp == NULL) { VAR_1 = -EINVAL; v9fs_path_init(&path); VAR_1 = v9fs_co_name_to_path(pdu, &dfidp->path, name.data, &path); if (VAR_1 < 0) { goto out_err; VAR_1 = v9fs_mark_fids_unreclaim(pdu, &path); if (VAR_1 < 0) { goto out_err; VAR_1 = v9fs_co_unlinkat(pdu, &dfidp->path, &name, flags); if (!VAR_1) { VAR_1 = offset; out_err:
put_fid(pdu, dfidp); v9fs_path_free(&path); out_nofid:
pdu_complete(pdu, VAR_1); v9fs_string_free(&name);