History

vfs: Use sequence counter with associated spinlock

A sequence counter write side critical section must be protected by some form of locking to serialize writers. A plain seqcount_t does not contain the information of which lock must be held when entering a write side critical section. Use the new seqcount_spinlock_t data type, which allows to associate a spinlock with the sequence counter. This enables lockdep to verify that the spinlock used for writer serialization is held when the write side critical section is entered. If lockdep is disabled this lock association is compiled out and has neither storage size nor runtime overhead.

Ahmed S. Darwish committed 6 years ago

Commit 26475371 parent 025e82b4 files · +5 −5Browse files

Showing the changes to include/linux (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/dcache.h +1 −1
  2. include/linux/fs_struct.h +1 −1
include/linux/dcache.h+1−1
@@ -89,7 +89,7 @@ extern struct dentry_stat_t dentry_stat; · 88 unmodified lines
89struct dentry {89struct dentry {
90 /* RCU lookup touched fields */90 /* RCU lookup touched fields */
91 unsigned int d_flags; /* protected by d_lock */91 unsigned int d_flags; /* protected by d_lock */
92 seqcount_t d_seq; /* per dentry seqlock */92 seqcount_spinlock_t d_seq; /* per dentry seqlock */
93 struct hlist_bl_node d_hash; /* lookup hash list */93 struct hlist_bl_node d_hash; /* lookup hash list */
94 struct dentry *d_parent; /* parent directory */94 struct dentry *d_parent; /* parent directory */
95 struct qstr d_name;95 struct qstr d_name;
include/linux/fs_struct.h+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
9struct fs_struct {9struct fs_struct {
10 int users;10 int users;
11 spinlock_t lock;11 spinlock_t lock;
12 seqcount_t seq;12 seqcount_spinlock_t seq;
13 int umask;13 int umask;
14 int in_exec;14 int in_exec;
15 struct path root, pwd;15 struct path root, pwd;

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