diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-02-20 14:06:05 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-02-20 14:06:05 -0500 |
commit | e942f883bc6651d50be139477baf6fb0eed3d5bb (patch) | |
tree | e1d19783e9c8b42198a69c17c9719fb90f302847 /fs/btrfs/ctree.h | |
parent | b2c6b3e0611c58fbeb6b9c0892b6249f7bdfaf6b (diff) | |
parent | 0e4e02636611dbf89a2f36320a32054f9936d6cb (diff) |
Merge branch 'raid56-experimental' into for-linus-3.9
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Conflicts:
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/volumes.c
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 1679051f4d39..3dcedfe4f759 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -506,6 +506,7 @@ struct btrfs_super_block { | |||
506 | #define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5) | 506 | #define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5) |
507 | 507 | ||
508 | #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) | 508 | #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) |
509 | #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) | ||
509 | 510 | ||
510 | #define BTRFS_FEATURE_COMPAT_SUPP 0ULL | 511 | #define BTRFS_FEATURE_COMPAT_SUPP 0ULL |
511 | #define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL | 512 | #define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL |
@@ -515,6 +516,7 @@ struct btrfs_super_block { | |||
515 | BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS | \ | 516 | BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS | \ |
516 | BTRFS_FEATURE_INCOMPAT_BIG_METADATA | \ | 517 | BTRFS_FEATURE_INCOMPAT_BIG_METADATA | \ |
517 | BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO | \ | 518 | BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO | \ |
519 | BTRFS_FEATURE_INCOMPAT_RAID56 | \ | ||
518 | BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) | 520 | BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) |
519 | 521 | ||
520 | /* | 522 | /* |
@@ -956,6 +958,8 @@ struct btrfs_dev_replace_item { | |||
956 | #define BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4) | 958 | #define BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4) |
957 | #define BTRFS_BLOCK_GROUP_DUP (1ULL << 5) | 959 | #define BTRFS_BLOCK_GROUP_DUP (1ULL << 5) |
958 | #define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6) | 960 | #define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6) |
961 | #define BTRFS_BLOCK_GROUP_RAID5 (1 << 7) | ||
962 | #define BTRFS_BLOCK_GROUP_RAID6 (1 << 8) | ||
959 | #define BTRFS_BLOCK_GROUP_RESERVED BTRFS_AVAIL_ALLOC_BIT_SINGLE | 963 | #define BTRFS_BLOCK_GROUP_RESERVED BTRFS_AVAIL_ALLOC_BIT_SINGLE |
960 | 964 | ||
961 | enum btrfs_raid_types { | 965 | enum btrfs_raid_types { |
@@ -964,6 +968,8 @@ enum btrfs_raid_types { | |||
964 | BTRFS_RAID_DUP, | 968 | BTRFS_RAID_DUP, |
965 | BTRFS_RAID_RAID0, | 969 | BTRFS_RAID_RAID0, |
966 | BTRFS_RAID_SINGLE, | 970 | BTRFS_RAID_SINGLE, |
971 | BTRFS_RAID_RAID5, | ||
972 | BTRFS_RAID_RAID6, | ||
967 | BTRFS_NR_RAID_TYPES | 973 | BTRFS_NR_RAID_TYPES |
968 | }; | 974 | }; |
969 | 975 | ||
@@ -973,6 +979,8 @@ enum btrfs_raid_types { | |||
973 | 979 | ||
974 | #define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 | \ | 980 | #define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 | \ |
975 | BTRFS_BLOCK_GROUP_RAID1 | \ | 981 | BTRFS_BLOCK_GROUP_RAID1 | \ |
982 | BTRFS_BLOCK_GROUP_RAID5 | \ | ||
983 | BTRFS_BLOCK_GROUP_RAID6 | \ | ||
976 | BTRFS_BLOCK_GROUP_DUP | \ | 984 | BTRFS_BLOCK_GROUP_DUP | \ |
977 | BTRFS_BLOCK_GROUP_RAID10) | 985 | BTRFS_BLOCK_GROUP_RAID10) |
978 | /* | 986 | /* |
@@ -1197,6 +1205,10 @@ struct btrfs_block_group_cache { | |||
1197 | u64 flags; | 1205 | u64 flags; |
1198 | u64 sectorsize; | 1206 | u64 sectorsize; |
1199 | u64 cache_generation; | 1207 | u64 cache_generation; |
1208 | |||
1209 | /* for raid56, this is a full stripe, without parity */ | ||
1210 | unsigned long full_stripe_len; | ||
1211 | |||
1200 | unsigned int ro:1; | 1212 | unsigned int ro:1; |
1201 | unsigned int dirty:1; | 1213 | unsigned int dirty:1; |
1202 | unsigned int iref:1; | 1214 | unsigned int iref:1; |
@@ -1242,6 +1254,23 @@ enum btrfs_orphan_cleanup_state { | |||
1242 | ORPHAN_CLEANUP_DONE = 2, | 1254 | ORPHAN_CLEANUP_DONE = 2, |
1243 | }; | 1255 | }; |
1244 | 1256 | ||
1257 | /* used by the raid56 code to lock stripes for read/modify/write */ | ||
1258 | struct btrfs_stripe_hash { | ||
1259 | struct list_head hash_list; | ||
1260 | wait_queue_head_t wait; | ||
1261 | spinlock_t lock; | ||
1262 | }; | ||
1263 | |||
1264 | /* used by the raid56 code to lock stripes for read/modify/write */ | ||
1265 | struct btrfs_stripe_hash_table { | ||
1266 | struct list_head stripe_cache; | ||
1267 | spinlock_t cache_lock; | ||
1268 | int cache_size; | ||
1269 | struct btrfs_stripe_hash table[]; | ||
1270 | }; | ||
1271 | |||
1272 | #define BTRFS_STRIPE_HASH_TABLE_BITS 11 | ||
1273 | |||
1245 | /* fs_info */ | 1274 | /* fs_info */ |
1246 | struct reloc_control; | 1275 | struct reloc_control; |
1247 | struct btrfs_device; | 1276 | struct btrfs_device; |
@@ -1341,6 +1370,13 @@ struct btrfs_fs_info { | |||
1341 | struct mutex cleaner_mutex; | 1370 | struct mutex cleaner_mutex; |
1342 | struct mutex chunk_mutex; | 1371 | struct mutex chunk_mutex; |
1343 | struct mutex volume_mutex; | 1372 | struct mutex volume_mutex; |
1373 | |||
1374 | /* this is used during read/modify/write to make sure | ||
1375 | * no two ios are trying to mod the same stripe at the same | ||
1376 | * time | ||
1377 | */ | ||
1378 | struct btrfs_stripe_hash_table *stripe_hash_table; | ||
1379 | |||
1344 | /* | 1380 | /* |
1345 | * this protects the ordered operations list only while we are | 1381 | * this protects the ordered operations list only while we are |
1346 | * processing all of the entries on it. This way we make | 1382 | * processing all of the entries on it. This way we make |
@@ -1423,6 +1459,8 @@ struct btrfs_fs_info { | |||
1423 | struct btrfs_workers flush_workers; | 1459 | struct btrfs_workers flush_workers; |
1424 | struct btrfs_workers endio_workers; | 1460 | struct btrfs_workers endio_workers; |
1425 | struct btrfs_workers endio_meta_workers; | 1461 | struct btrfs_workers endio_meta_workers; |
1462 | struct btrfs_workers endio_raid56_workers; | ||
1463 | struct btrfs_workers rmw_workers; | ||
1426 | struct btrfs_workers endio_meta_write_workers; | 1464 | struct btrfs_workers endio_meta_write_workers; |
1427 | struct btrfs_workers endio_write_workers; | 1465 | struct btrfs_workers endio_write_workers; |
1428 | struct btrfs_workers endio_freespace_worker; | 1466 | struct btrfs_workers endio_freespace_worker; |
@@ -3490,9 +3528,9 @@ int btrfs_writepages(struct address_space *mapping, | |||
3490 | struct writeback_control *wbc); | 3528 | struct writeback_control *wbc); |
3491 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, | 3529 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, |
3492 | struct btrfs_root *new_root, u64 new_dirid); | 3530 | struct btrfs_root *new_root, u64 new_dirid); |
3493 | int btrfs_merge_bio_hook(struct page *page, unsigned long offset, | 3531 | int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, |
3494 | size_t size, struct bio *bio, unsigned long bio_flags); | 3532 | size_t size, struct bio *bio, |
3495 | 3533 | unsigned long bio_flags); | |
3496 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); | 3534 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); |
3497 | int btrfs_readpage(struct file *file, struct page *page); | 3535 | int btrfs_readpage(struct file *file, struct page *page); |
3498 | void btrfs_evict_inode(struct inode *inode); | 3536 | void btrfs_evict_inode(struct inode *inode); |