static void local_mapped_file_attr(FsContext *ctx, const char *path,

                                   struct stat *stbuf)

{

    FILE *fp;

    char buf[ATTR_MAX];

    char attr_path[PATH_MAX];



    local_mapped_attr_path(ctx, path, attr_path);

    fp = local_fopen(attr_path, "r");

    if (!fp) {

        return;

    }

    memset(buf, 0, ATTR_MAX);

    while (fgets(buf, ATTR_MAX, fp)) {

        if (!strncmp(buf, "virtfs.uid", 10)) {

            stbuf->st_uid = atoi(buf+11);

        } else if (!strncmp(buf, "virtfs.gid", 10)) {

            stbuf->st_gid = atoi(buf+11);

        } else if (!strncmp(buf, "virtfs.mode", 11)) {

            stbuf->st_mode = atoi(buf+12);

        } else if (!strncmp(buf, "virtfs.rdev", 11)) {

            stbuf->st_rdev = atoi(buf+12);

        }

        memset(buf, 0, ATTR_MAX);

    }

    fclose(fp);

}

static void local_mapped_file_attr(FsContext *ctx, const char *path,

                                   struct stat *stbuf)

{

    FILE *fp;

    char buf[ATTR_MAX];

    char attr_path[PATH_MAX];



    local_mapped_attr_path(ctx, path, attr_path);

    fp = local_fopen(attr_path, "r");

    if (!fp) {

        return;

    }

    memset(buf, 0, ATTR_MAX);

    while (fgets(buf, ATTR_MAX, fp)) {

        if (!strncmp(buf, "virtfs.uid", 10)) {

            stbuf->st_uid = atoi(buf+11);

        } else if (!strncmp(buf, "virtfs.gid", 10)) {

            stbuf->st_gid = atoi(buf+11);

        } else if (!strncmp(buf, "virtfs.mode", 11)) {

            stbuf->st_mode = atoi(buf+12);

        } else if (!strncmp(buf, "virtfs.rdev", 11)) {

            stbuf->st_rdev = atoi(buf+12);

        }

        memset(buf, 0, ATTR_MAX);

    }

    fclose(fp);

}

static void FUNC_0(FsContext *VAR_0, const char *VAR_1,

                                   struct stat *VAR_2)

{

    FILE *fp;

    char VAR_3[ATTR_MAX];

    char VAR_4[PATH_MAX];



    local_mapped_attr_path(VAR_0, VAR_1, VAR_4);

    fp = local_fopen(VAR_4, "r");

    if (!fp) {

        return;

    }

    memset(VAR_3, 0, ATTR_MAX);

    while (fgets(VAR_3, ATTR_MAX, fp)) {

        if (!strncmp(VAR_3, "virtfs.uid", 10)) {

            VAR_2->st_uid = atoi(VAR_3+11);

        } else if (!strncmp(VAR_3, "virtfs.gid", 10)) {

            VAR_2->st_gid = atoi(VAR_3+11);

        } else if (!strncmp(VAR_3, "virtfs.mode", 11)) {

            VAR_2->st_mode = atoi(VAR_3+12);

        } else if (!strncmp(VAR_3, "virtfs.rdev", 11)) {

            VAR_2->st_rdev = atoi(VAR_3+12);

        }

        memset(VAR_3, 0, ATTR_MAX);

    }

    fclose(fp);

}

static void FUNC_0(FsContext *VAR_0, const char *VAR_1,
struct stat *VAR_2)
{ FILE *fp; char VAR_3[ATTR_MAX]; char VAR_4[PATH_MAX]; local_mapped_attr_path(VAR_0, VAR_1, VAR_4); fp = local_fopen(VAR_4, "r"); if (!fp) { return; } memset(VAR_3, 0, ATTR_MAX); while (fgets(VAR_3, ATTR_MAX, fp)) { if (!strncmp(VAR_3, "virtfs.uid", 10)) { VAR_2->st_uid = atoi(VAR_3+11); } else if (!strncmp(VAR_3, "virtfs.gid", 10)) { VAR_2->st_gid = atoi(VAR_3+11); } else if (!strncmp(VAR_3, "virtfs.mode", 11)) { VAR_2->st_mode = atoi(VAR_3+12); } else if (!strncmp(VAR_3, "virtfs.rdev", 11)) { VAR_2->st_rdev = atoi(VAR_3+12); } memset(VAR_3, 0, ATTR_MAX); } fclose(fp); }