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 | 68 | * can be non-atomic on 32bit machines with 64bit sector_t. |
| 69 | 69 | */ |
| 70 | 70 | sector_t nr_sects; |
| 71 | +#if BITS_PER_LONG==32 && defined(CONFIG_SMP) | |
| 71 | 72 | seqcount_t nr_sects_seq; |
| 73 | +#endif | |
| 72 | 74 | sector_t alignment_offset; |
| 73 | 75 | unsigned int discard_alignment; |
| 74 | 76 | struct device __dev; |
| @@ -274,6 +276,13 @@ static inline void disk_put_part(struct hd_struct *part) · 199 unmodified lines | ||
| 274 | 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 | 287 | * Smarter partition iterator without context limits. |
| 279 | 288 | */ |