Include information about PPL location and size into mdp_superblock_1 and copy it to/from rdev. Because PPL is mutually exclusive with bitmap, put it in place of 'bitmap_offset'. Add a new flag MD_FEATURE_PPL for 'feature_map', analogically to MD_FEATURE_BITMAP_OFFSET. Add MD_HAS_PPL to mddev->flags to indicate that PPL is enabled on an array.
Showing the changes to include/uapi/linux/raid (1 of 5 files). Show all
Unified · Split
| @@ -242,10 +242,18 @@ struct mdp_superblock_1 { · 241 unmodified lines | ||
| 242 | 242 | |
| 243 | 243 | __le32 chunksize; /* in 512byte sectors */ |
| 244 | 244 | __le32 raid_disks; |
| 245 | − __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts | |
| 246 | − * NOTE: signed, so bitmap can be before superblock | |
| 247 | − * only meaningful of feature_map[0] is set. | |
| 248 | − */ | |
| 245 | + union { | |
| 246 | + __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts | |
| 247 | + * NOTE: signed, so bitmap can be before superblock | |
| 248 | + * only meaningful of feature_map[0] is set. | |
| 249 | + */ | |
| 250 | + | |
| 251 | + /* only meaningful when feature_map[MD_FEATURE_PPL] is set */ | |
| 252 | + struct { | |
| 253 | + __le16 offset; /* sectors from start of superblock that ppl starts (signed) */ | |
| 254 | + __le16 size; /* ppl size in sectors */ | |
| 255 | + } ppl; | |
| 256 | + }; | |
| 249 | 257 | |
| 250 | 258 | /* These are only valid with feature bit '4' */ |
| 251 | 259 | __le32 new_level; /* new level we are reshaping to */ |
| @@ -318,6 +326,7 @@ struct mdp_superblock_1 { · 66 unmodified lines | ||
| 318 | 326 | */ |
| 319 | 327 | #define MD_FEATURE_CLUSTERED 256 /* clustered MD */ |
| 320 | 328 | #define MD_FEATURE_JOURNAL 512 /* support write cache */ |
| 329 | +#define MD_FEATURE_PPL 1024 /* support PPL */ | |
| 321 | 330 | #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ |
| 322 | 331 | |MD_FEATURE_RECOVERY_OFFSET \ |
| 323 | 332 | |MD_FEATURE_RESHAPE_ACTIVE \ |
| @@ -328,6 +337,7 @@ struct mdp_superblock_1 { · 4 unmodified lines | ||
| 328 | 337 | |MD_FEATURE_RECOVERY_BITMAP \ |
| 329 | 338 | |MD_FEATURE_CLUSTERED \ |
| 330 | 339 | |MD_FEATURE_JOURNAL \ |
| 340 | + |MD_FEATURE_PPL \ | |
| 331 | 341 | ) |
| 332 | 342 | |
| 333 | 343 | struct r5l_payload_header { |