static int local_rename(FsContext *ctx, const char *oldpath,

                        const char *newpath)

{

    int err;

    char *buffer, *buffer1;



    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        err = local_create_mapped_attr_dir(ctx, newpath);

        if (err < 0) {

            return err;

        }

        /* rename the .virtfs_metadata files */

        buffer = local_mapped_attr_path(ctx, oldpath);

        buffer1 = local_mapped_attr_path(ctx, newpath);

        err = rename(buffer, buffer1);

        g_free(buffer);

        g_free(buffer1);

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

            return err;

        }

    }



    buffer = rpath(ctx, oldpath);

    buffer1 = rpath(ctx, newpath);

    err = rename(buffer, buffer1);

    g_free(buffer);

    g_free(buffer1);

    return err;

}

static int local_rename(FsContext *ctx, const char *oldpath,

                        const char *newpath)

{

    int err;

    char *buffer, *buffer1;



    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        err = local_create_mapped_attr_dir(ctx, newpath);

        if (err < 0) {

            return err;

        }

        

        buffer = local_mapped_attr_path(ctx, oldpath);

        buffer1 = local_mapped_attr_path(ctx, newpath);

        err = rename(buffer, buffer1);

        g_free(buffer);

        g_free(buffer1);

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

            return err;

        }

    }



    buffer = rpath(ctx, oldpath);

    buffer1 = rpath(ctx, newpath);

    err = rename(buffer, buffer1);

    g_free(buffer);

    g_free(buffer1);

    return err;

}

static int local_rename(FsContext *ctx, const char *oldpath,                         const char *newpath)     int err;     char *buffer, *buffer1;     if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {         err = local_create_mapped_attr_dir(ctx, newpath);         if (err < 0) {             return err;         buffer = local_mapped_attr_path(ctx, oldpath);         buffer1 = local_mapped_attr_path(ctx, newpath);         err = rename(buffer, buffer1);         g_free(buffer);         g_free(buffer1);         if (err < 0 && errno != ENOENT) {             return err;     buffer = rpath(ctx, oldpath);     buffer1 = rpath(ctx, newpath);     err = rename(buffer, buffer1);     g_free(buffer);     g_free(buffer1);     return err;
static int FUNC_0(FsContext *VAR_0, const char *VAR_1,

                        const char *VAR_2)

{

    int VAR_3;

    char *VAR_4, *VAR_5;



    if (VAR_0->export_flags & V9FS_SM_MAPPED_FILE) {

        VAR_3 = local_create_mapped_attr_dir(VAR_0, VAR_2);

        if (VAR_3 < 0) {

            return VAR_3;

        }

        

        VAR_4 = local_mapped_attr_path(VAR_0, VAR_1);

        VAR_5 = local_mapped_attr_path(VAR_0, VAR_2);

        VAR_3 = rename(VAR_4, VAR_5);

        g_free(VAR_4);

        g_free(VAR_5);

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

            return VAR_3;

        }

    }



    VAR_4 = rpath(VAR_0, VAR_1);

    VAR_5 = rpath(VAR_0, VAR_2);

    VAR_3 = rename(VAR_4, VAR_5);

    g_free(VAR_4);

    g_free(VAR_5);

    return VAR_3;

}

static int FUNC_0(FsContext *VAR_0, const char *VAR_1,
const char *VAR_2)
{ int VAR_3; char *VAR_4, *VAR_5; if (VAR_0->export_flags & V9FS_SM_MAPPED_FILE) { VAR_3 = local_create_mapped_attr_dir(VAR_0, VAR_2); if (VAR_3 < 0) { return VAR_3; } VAR_4 = local_mapped_attr_path(VAR_0, VAR_1); VAR_5 = local_mapped_attr_path(VAR_0, VAR_2); VAR_3 = rename(VAR_4, VAR_5); g_free(VAR_4); g_free(VAR_5); if (VAR_3 < 0 && errno != ENOENT) { return VAR_3; } } VAR_4 = rpath(VAR_0, VAR_1); VAR_5 = rpath(VAR_0, VAR_2); VAR_3 = rename(VAR_4, VAR_5); g_free(VAR_4); g_free(VAR_5); return VAR_3; }