#define XFS_ITRUNC_MAYBE 0x2
/*
- * Maximum file size.
- * if XFS_BIG_FILES 2^63 - 1 (largest positive value of xfs_fsize_t)
+ * if XFS_BIG_FILES, 2^(32+PAGE_SHIFT) - 1 (due to linux page cache),
* else 2^40 - 1 (40=31+9) (might be an int holding a block #)
- * Note, we allow seeks to this offset, although you can't read or write.
* For the not XFS_BIG_FILES case, the value could be 1 higher but we don't
* do that, for symmetry.
+ *
+ * NOTE: XFS itself can handle 2^63 - 1 (largest positive value of xfs_fsize_t)
+ * but Linux can't go above 2^(32+PAGE_SHIFT)-1: the Linux VM uses a 32 bit
+ * page number index to index cache data, so 2^32 * PAGE_SIZE is as big as
+ * you can go.
*/
#if XFS_BIG_FILES
-#define XFS_MAX_FILE_OFFSET ((long long)((1ULL<<63)-1ULL))
+#define XFS_MAX_FILE_OFFSET ((long long)((1ULL<<(32+PAGE_SHIFT))-1ULL))
#else
#define XFS_MAX_FILE_OFFSET ((1LL<<40)-1LL)
#endif