OSDN Git Service

Report block size = fragment size = cluster size.
authorrelan <relan@users.noreply.github.com>
Sun, 19 Sep 2010 10:40:40 +0000 (10:40 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:12 +0000 (08:26 +0300)
This fixes displaying of FS size under Mac OS X.

fuse/main.c

index 0a6901f..f79209c 100644 (file)
@@ -227,13 +227,10 @@ static int fuse_exfat_utimens(const char* path, const struct timespec tv[2])
 
 static int fuse_exfat_statfs(const char* path, struct statvfs* sfs)
 {
-       const uint64_t block_count = le64_to_cpu(ef.sb->block_count);
-
-       sfs->f_bsize = BLOCK_SIZE(*ef.sb);
+       sfs->f_bsize = CLUSTER_SIZE(*ef.sb);
        sfs->f_frsize = CLUSTER_SIZE(*ef.sb);
-       sfs->f_blocks = block_count;
-       sfs->f_bavail = (fsblkcnt_t) exfat_count_free_clusters(&ef) *
-                       (CLUSTER_SIZE(*ef.sb) / BLOCK_SIZE(*ef.sb));
+       sfs->f_blocks = le64_to_cpu(ef.sb->block_count) >> ef.sb->bpc_bits;
+       sfs->f_bavail = exfat_count_free_clusters(&ef);
        sfs->f_bfree = sfs->f_bavail;
        sfs->f_namemax = EXFAT_NAME_MAX;