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
8989 struct dentry {
9090 /* RCU lookup touched fields */
9191 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 */
9393 struct hlist_bl_node d_hash; /* lookup hash list */
9494 struct dentry *d_parent; /* parent directory */
9595 struct qstr d_name;
include/linux/fs_struct.h+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 struct fs_struct {
1010 int users;
1111 spinlock_t lock;
12− seqcount_t seq;
12+ seqcount_spinlock_t seq;
1313 int umask;
1414 int in_exec;
1515 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