]> git.sven.stormbind.net Git - sven/exfat-utils.git/blobdiff - libexfat/cluster.c
New upstream version 1.2.5
[sven/exfat-utils.git] / libexfat / cluster.c
index fc3657b53f62e0ba101d6ed2be35b36ca87f8d38..34f027cc3270a8aa214e56b496bdc3530d80f4a3 100644 (file)
@@ -3,7 +3,7 @@
        exFAT file system implementation library.
 
        Free exFAT implementation.
-       Copyright (C) 2010-2015  Andrew Nayenko
+       Copyright (C) 2010-2016  Andrew Nayenko
 
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ static cluster_t s2c(const struct exfat* ef, off_t sector)
 static uint32_t bytes2clusters(const struct exfat* ef, uint64_t bytes)
 {
        uint64_t cluster_size = CLUSTER_SIZE(*ef->sb);
-       return (bytes + cluster_size - 1) / cluster_size;
+       return DIV_ROUND_UP(bytes, cluster_size);
 }
 
 cluster_t exfat_next_cluster(const struct exfat* ef,