OSDN Git Service

Add constant for the last possible valid cluster number.
authorrelan <relan@users.noreply.github.com>
Sun, 18 Mar 2012 13:05:04 +0000 (13:05 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:14 +0000 (08:26 +0300)
libexfat/exfat.h
libexfat/exfatfs.h

index bca0d24..a5a9ba1 100644 (file)
@@ -38,7 +38,7 @@
 #define IS_CONTIGUOUS(node) (((node).flags & EXFAT_ATTRIB_CONTIGUOUS) != 0)
 #define SECTOR_SIZE(sb) (1 << (sb).sector_bits)
 #define CLUSTER_SIZE(sb) (SECTOR_SIZE(sb) << (sb).spc_bits)
-#define CLUSTER_INVALID(c) ((c) == EXFAT_CLUSTER_BAD || (c) == EXFAT_CLUSTER_END)
+#define CLUSTER_INVALID(c) ((c) > EXFAT_LAST_DATA_CLUSTER)
 
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 #define DIV_ROUND_UP(x, d) (((x) + (d) - 1) / (d))
index 61e39a1..78a62e6 100644 (file)
@@ -26,6 +26,7 @@
 typedef uint32_t cluster_t;            /* cluster number */
 
 #define EXFAT_FIRST_DATA_CLUSTER 2
+#define EXFAT_LAST_DATA_CLUSTER 0xfffffff6
 
 #define EXFAT_CLUSTER_FREE         0 /* free cluster */
 #define EXFAT_CLUSTER_BAD 0xfffffff7 /* cluster contains bad sector */