static int local_remove(FsContext *ctx, const char *path)

{

    int err;

    struct stat stbuf;

    char *buffer;



    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        buffer = rpath(ctx, path);

        err =  lstat(buffer, &stbuf);

        g_free(buffer);

        if (err) {

            goto err_out;

        }

        /*

         * If directory remove .virtfs_metadata contained in the

         * directory

         */

        if (S_ISDIR(stbuf.st_mode)) {

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

                                     path, VIRTFS_META_DIR);

            err = remove(buffer);

            g_free(buffer);

            if (err < 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, path);

        err = remove(buffer);

        g_free(buffer);

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

            /*

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

             * in non-mapped mode ?. Ignore ENOENT.

             */

            goto err_out;

        }

    }



    buffer = rpath(ctx, path);

    err = remove(buffer);

    g_free(buffer);

err_out:

    return err;

}

static int local_remove(FsContext *ctx, const char *path)

{

    int err;

    struct stat stbuf;

    char *buffer;



    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        buffer = rpath(ctx, path);

        err =  lstat(buffer, &stbuf);

        g_free(buffer);

        if (err) {

            goto err_out;

        }

        







        if (S_ISDIR(stbuf.st_mode)) {

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

                                     path, VIRTFS_META_DIR);

            err = remove(buffer);

            g_free(buffer);

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

                







                goto err_out;

            }

        }

        







        buffer = local_mapped_attr_path(ctx, path);

        err = remove(buffer);

        g_free(buffer);

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

            







            goto err_out;

        }

    }



    buffer = rpath(ctx, path);

    err = remove(buffer);

    g_free(buffer);

err_out:

    return err;

}

    int err;     char *buffer;     if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {         buffer = rpath(ctx, path);         err =  lstat(buffer, &stbuf);         g_free(buffer);         if (err) {             goto err_out;         if (S_ISDIR(stbuf.st_mode)) {             buffer = g_strdup_printf("%s/%s/%s", ctx->fs_root,                                      path, VIRTFS_META_DIR);             err = remove(buffer);             g_free(buffer);             if (err < 0 && errno != ENOENT) {                 goto err_out;         buffer = local_mapped_attr_path(ctx, path);         err = remove(buffer);         g_free(buffer);         if (err < 0 && errno != ENOENT) {             goto err_out;     buffer = rpath(ctx, path);     err = remove(buffer);     g_free(buffer);
static int FUNC_0(FsContext *VAR_0, const char *VAR_1)

{

    int VAR_2;

    struct stat VAR_3;

    char *VAR_4;



    if (VAR_0->export_flags & V9FS_SM_MAPPED_FILE) {

        VAR_4 = rpath(VAR_0, VAR_1);

        VAR_2 =  lstat(VAR_4, &VAR_3);

        g_free(VAR_4);

        if (VAR_2) {

            goto err_out;

        }

        







        if (S_ISDIR(VAR_3.st_mode)) {

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

                                     VAR_1, VIRTFS_META_DIR);

            VAR_2 = remove(VAR_4);

            g_free(VAR_4);

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

                







                goto err_out;

            }

        }

        







        VAR_4 = local_mapped_attr_path(VAR_0, VAR_1);

        VAR_2 = remove(VAR_4);

        g_free(VAR_4);

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

            







            goto err_out;

        }

    }



    VAR_4 = rpath(VAR_0, VAR_1);

    VAR_2 = remove(VAR_4);

    g_free(VAR_4);

err_out:

    return VAR_2;

}

static int FUNC_0(FsContext *VAR_0, const char *VAR_1)
{ int VAR_2; struct stat VAR_3; char *VAR_4; if (VAR_0->export_flags & V9FS_SM_MAPPED_FILE) { VAR_4 = rpath(VAR_0, VAR_1); VAR_2 =  lstat(VAR_4, &VAR_3); g_free(VAR_4); if (VAR_2) { goto err_out; } if (S_ISDIR(VAR_3.st_mode)) { VAR_4 = g_strdup_printf("%s/%s/%s", VAR_0->fs_root,
VAR_1, VIRTFS_META_DIR); VAR_2 = remove(VAR_4); g_free(VAR_4); if (VAR_2 < 0 && errno != ENOENT) { goto err_out; } } VAR_4 = local_mapped_attr_path(VAR_0, VAR_1); VAR_2 = remove(VAR_4); g_free(VAR_4); if (VAR_2 < 0 && errno != ENOENT) { goto err_out; } } VAR_4 = rpath(VAR_0, VAR_1); VAR_2 = remove(VAR_4); g_free(VAR_4); err_out:
return VAR_2; }