static int nodeck(struct exfat* ef, struct exfat_node* node)
{
const cluster_t cluster_size = CLUSTER_SIZE(*ef->sb);
- cluster_t clusters = (node->size + cluster_size - 1) / cluster_size;
+ cluster_t clusters = DIV_ROUND_UP(node->size, cluster_size);
cluster_t c = node->start_cluster;
int rc = 0;
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,