The seqcount of 'nr_sects_seq' is only needed in case of 32bit SMP, so define it just for 32bit SMP.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -68,7 +68,9 @@ struct hd_struct { · 67 unmodified lines | |||
| 68 | * can be non-atomic on 32bit machines with 64bit sector_t. | 68 | * can be non-atomic on 32bit machines with 64bit sector_t. |
| 69 | */ | 69 | */ |
| 70 | sector_t nr_sects; | 70 | sector_t nr_sects; |
| 71 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 71 | seqcount_t nr_sects_seq; | 72 | seqcount_t nr_sects_seq; |
| 73 | #endif | ||
| 72 | sector_t alignment_offset; | 74 | sector_t alignment_offset; |
| 73 | unsigned int discard_alignment; | 75 | unsigned int discard_alignment; |
| 74 | struct device __dev; | 76 | struct device __dev; |
| @@ -274,6 +276,13 @@ static inline void disk_put_part(struct hd_struct *part) · 199 unmodified lines | |||
| 274 | put_device(part_to_dev(part)); | 276 | put_device(part_to_dev(part)); |
| 275 | } | 277 | } |
| 276 | 278 | ||
| 279 | static inline void hd_sects_seq_init(struct hd_struct *p) | ||
| 280 | { | ||
| 281 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 282 | seqcount_init(&p->nr_sects_seq); | ||
| 283 | #endif | ||
| 284 | } | ||
| 285 | |||
| 277 | /* | 286 | /* |
| 278 | * Smarter partition iterator without context limits. | 287 | * Smarter partition iterator without context limits. |
| 279 | */ | 288 | */ |