OSDN Git Service

Remove separate field for the root directory size.
authorrelan <relan@users.noreply.github.com>
Mon, 26 Oct 2009 19:46:21 +0000 (19:46 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:10 +0000 (08:26 +0300)
Root directory size is a part of the root node.

libexfat/exfat.h
libexfat/mount.c

index 6bfcea3..7004d7b 100644 (file)
@@ -47,7 +47,6 @@ struct exfat
 {
        struct exfat_super_block* sb;
        int fd;
-       uint64_t rootdir_size;
        le16_t* upcase;
        size_t upcase_chars;
        struct exfat_node* root;
index 64e8968..6c91353 100644 (file)
@@ -60,7 +60,6 @@ int exfat_mount(struct exfat* ef, const char* spec)
 
        ef->upcase = NULL;
        ef->upcase_chars = 0;
-       ef->rootdir_size = rootdir_size(ef);
 
        ef->root = malloc(sizeof(struct exfat_node));
        if (ef->root == NULL)
@@ -72,9 +71,9 @@ int exfat_mount(struct exfat* ef, const char* spec)
        }
        memset(ef->root, 0, sizeof(struct exfat_node));
        ef->root->flags = EXFAT_ATTRIB_DIR;
-       ef->root->size = ef->rootdir_size;
        ef->root->start_cluster = le32_to_cpu(ef->sb->rootdir_cluster);
        ef->root->name[0] = cpu_to_le16('\0');
+       ef->root->size = rootdir_size(ef);
        /* exFAT does not have time attributes for the root directory */
        ef->root->mtime = 0;
        ef->root->atime = 0;