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
6868 * can be non-atomic on 32bit machines with 64bit sector_t.
6969 */
7070 sector_t nr_sects;
71+#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
7172 seqcount_t nr_sects_seq;
73+#endif
7274 sector_t alignment_offset;
7375 unsigned int discard_alignment;
7476 struct device __dev;
@@ -274,6 +276,13 @@ static inline void disk_put_part(struct hd_struct *part) · 199 unmodified lines
274276 put_device(part_to_dev(part));
275277 }
276278
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+
277286 /*
278287 * Smarter partition iterator without context limits.
279288 */

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