History

block: only define 'nr_sects_seq' in hd_part for 32bit SMP

The seqcount of 'nr_sects_seq' is only needed in case of 32bit SMP, so define it just for 32bit SMP.

Ming Lei committed 6 years ago

Commit 07c4e1e1 parent b7d6c303 files · +11 −2Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/genhd.h+9−0
@@ -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
279static 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 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t