OSDN Git Service

Generic I/O for directories: switch rename_entry().
[android-x86/external-exfat.git] / libexfat / utils.c
index fd304b2..c633a29 100644 (file)
@@ -29,7 +29,7 @@ void exfat_stat(const struct exfat* ef, const struct exfat_node* node,
                struct stat* stbuf)
 {
        memset(stbuf, 0, sizeof(struct stat));
-       if (node->flags & EXFAT_ATTRIB_DIR)
+       if (node->attrib & EXFAT_ATTRIB_DIR)
                stbuf->st_mode = S_IFDIR | (0777 & ~ef->dmask);
        else
                stbuf->st_mode = S_IFREG | (0777 & ~ef->fmask);
@@ -37,8 +37,7 @@ void exfat_stat(const struct exfat* ef, const struct exfat_node* node,
        stbuf->st_uid = ef->uid;
        stbuf->st_gid = ef->gid;
        stbuf->st_size = node->size;
-       stbuf->st_blocks = DIV_ROUND_UP(node->size, CLUSTER_SIZE(*ef->sb)) *
-               CLUSTER_SIZE(*ef->sb) / 512;
+       stbuf->st_blocks = ROUND_UP(node->size, CLUSTER_SIZE(*ef->sb)) / 512;
        stbuf->st_mtime = node->mtime;
        stbuf->st_atime = node->atime;
        /* set ctime to mtime to ensure we don't break programs that rely on ctime