[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.9 (#4417)
[reactos.git] / drivers / filesystems / btrfs / flushthread.c
index 565f400..a574d43 100644 (file)
 #include <ntddscsi.h>
 #include <ntddstor.h>
 
-#define MAX_CSUM_SIZE (4096 - sizeof(tree_header) - sizeof(leaf_node))
+/* cf. __MAX_CSUM_ITEMS in Linux - it needs sizeof(leaf_node) bytes free
+ * so it can do a split. Linux tries to get it so a run will fit in a
+ * sector, but the MAX_CSUM_ITEMS logic is wrong... */
+#define MAX_CSUM_SIZE (4096 - sizeof(tree_header) - (2 * sizeof(leaf_node)))
 
 // #define DEBUG_WRITE_LOOPS