static int local_unlinkat(FsContext *ctx, V9fsPath *dir,

                          const char *name, int flags)

{

    int ret;

    V9fsString fullname;

    char *buffer;



    v9fs_string_init(&fullname);



    v9fs_string_sprintf(&fullname, "%s/%s", dir->data, name);

    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        if (flags == AT_REMOVEDIR) {

            /*

             * If directory remove .virtfs_metadata contained in the

             * directory

             */

            buffer = g_strdup_printf("%s/%s/%s", ctx->fs_root,

                                     fullname.data, VIRTFS_META_DIR);

            ret = remove(buffer);

            g_free(buffer);

            if (ret < 0 && errno != ENOENT) {

                /*

                 * We didn't had the .virtfs_metadata file. May be file created

                 * in non-mapped mode ?. Ignore ENOENT.

                 */

                goto err_out;

            }

        }

        /*

         * Now remove the name from parent directory

         * .virtfs_metadata directory.

         */

        buffer = local_mapped_attr_path(ctx, fullname.data);

        ret = remove(buffer);

        g_free(buffer);

        if (ret < 0 && errno != ENOENT) {

            /*

             * We didn't had the .virtfs_metadata file. May be file created

             * in non-mapped mode ?. Ignore ENOENT.

             */

            goto err_out;

        }

    }

    /* Remove the name finally */

    buffer = rpath(ctx, fullname.data);

    ret = remove(buffer);

    g_free(buffer);



err_out:

    v9fs_string_free(&fullname);

    return ret;

}

static int local_unlinkat(FsContext *ctx, V9fsPath *dir,

                          const char *name, int flags)

{

    int ret;

    V9fsString fullname;

    char *buffer;



    v9fs_string_init(&fullname);



    v9fs_string_sprintf(&fullname, "%s/%s", dir->data, name);

    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        if (flags == AT_REMOVEDIR) {

            







            buffer = g_strdup_printf("%s/%s/%s", ctx->fs_root,

                                     fullname.data, VIRTFS_META_DIR);

            ret = remove(buffer);

            g_free(buffer);

            if (ret < 0 && errno != ENOENT) {

                







                goto err_out;

            }

        }

        







        buffer = local_mapped_attr_path(ctx, fullname.data);

        ret = remove(buffer);

        g_free(buffer);

        if (ret < 0 && errno != ENOENT) {

            







            goto err_out;

        }

    }

    

    buffer = rpath(ctx, fullname.data);

    ret = remove(buffer);

    g_free(buffer);



err_out:

    v9fs_string_free(&fullname);

    return ret;

}

    V9fsString fullname;     char *buffer;     v9fs_string_init(&fullname);     v9fs_string_sprintf(&fullname, "%s/%s", dir->data, name);     if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {         if (flags == AT_REMOVEDIR) {             buffer = g_strdup_printf("%s/%s/%s", ctx->fs_root,                                      fullname.data, VIRTFS_META_DIR);             ret = remove(buffer);             g_free(buffer);             if (ret < 0 && errno != ENOENT) {                 goto err_out;         buffer = local_mapped_attr_path(ctx, fullname.data);         ret = remove(buffer);         g_free(buffer);         if (ret < 0 && errno != ENOENT) {             goto err_out;     buffer = rpath(ctx, fullname.data);     ret = remove(buffer);     g_free(buffer); err_out:     v9fs_string_free(&fullname);
static int FUNC_0(FsContext *VAR_0, V9fsPath *VAR_1,

                          const char *VAR_2, int VAR_3)

{

    int VAR_4;

    V9fsString fullname;

    char *VAR_5;



    v9fs_string_init(&fullname);



    v9fs_string_sprintf(&fullname, "%s/%s", VAR_1->data, VAR_2);

    if (VAR_0->export_flags & V9FS_SM_MAPPED_FILE) {

        if (VAR_3 == AT_REMOVEDIR) {

            







            VAR_5 = g_strdup_printf("%s/%s/%s", VAR_0->fs_root,

                                     fullname.data, VIRTFS_META_DIR);

            VAR_4 = remove(VAR_5);

            g_free(VAR_5);

            if (VAR_4 < 0 && errno != ENOENT) {

                







                goto err_out;

            }

        }

        







        VAR_5 = local_mapped_attr_path(VAR_0, fullname.data);

        VAR_4 = remove(VAR_5);

        g_free(VAR_5);

        if (VAR_4 < 0 && errno != ENOENT) {

            







            goto err_out;

        }

    }

    

    VAR_5 = rpath(VAR_0, fullname.data);

    VAR_4 = remove(VAR_5);

    g_free(VAR_5);



err_out:

    v9fs_string_free(&fullname);

    return VAR_4;

}

static int FUNC_0(FsContext *VAR_0, V9fsPath *VAR_1,
const char *VAR_2, int VAR_3)
{ int VAR_4; V9fsString fullname; char *VAR_5; v9fs_string_init(&fullname); v9fs_string_sprintf(&fullname, "%s/%s", VAR_1->data, VAR_2); if (VAR_0->export_flags & V9FS_SM_MAPPED_FILE) { if (VAR_3 == AT_REMOVEDIR) { VAR_5 = g_strdup_printf("%s/%s/%s", VAR_0->fs_root,
fullname.data, VIRTFS_META_DIR); VAR_4 = remove(VAR_5); g_free(VAR_5); if (VAR_4 < 0 && errno != ENOENT) { goto err_out; } } VAR_5 = local_mapped_attr_path(VAR_0, fullname.data); VAR_4 = remove(VAR_5); g_free(VAR_5); if (VAR_4 < 0 && errno != ENOENT) { goto err_out; } } VAR_5 = rpath(VAR_0, fullname.data); VAR_4 = remove(VAR_5); g_free(VAR_5); err_out:
v9fs_string_free(&fullname); return VAR_4; }