btrfs: tree-checker: Verify dev item
[sfrench/cifs-2.6.git] / fs / btrfs / volumes.h
index 3ad9d58d1b6618aea5d79220e48fdf98ac243360..38ed94b77202767d1a65502b8918d55927049361 100644 (file)
@@ -258,6 +258,15 @@ struct btrfs_fs_devices {
 
 #define BTRFS_BIO_INLINE_CSUM_SIZE     64
 
+#define BTRFS_MAX_DEVS(info) ((BTRFS_MAX_ITEM_SIZE(info)       \
+                       - sizeof(struct btrfs_chunk))           \
+                       / sizeof(struct btrfs_stripe) + 1)
+
+#define BTRFS_MAX_DEVS_SYS_CHUNK ((BTRFS_SYSTEM_CHUNK_ARRAY_SIZE       \
+                               - 2 * sizeof(struct btrfs_disk_key)     \
+                               - 2 * sizeof(struct btrfs_chunk))       \
+                               / sizeof(struct btrfs_stripe) + 1)
+
 /*
  * we need the mirror number and stripe index to be passed around
  * the call chain while we are processing end_io (especially errors).