diff options
author | 2020-07-20 17:55:24 +0200 | |
---|---|---|
committer | 2020-07-29 16:14:27 +0200 | |
commit | 26475371976c69489d3a8e6c8bbf35afbbc25055 (patch) | |
tree | 5f7ac08bbe80ab13cd56cd4dcf0cdf4d6829d061 /include/linux/dcache.h | |
parent | timekeeping: Use sequence counter with associated raw spinlock (diff) | |
download | linux-26475371976c69489d3a8e6c8bbf35afbbc25055.tar.gz linux-26475371976c69489d3a8e6c8bbf35afbbc25055.tar.bz2 linux-26475371976c69489d3a8e6c8bbf35afbbc25055.zip |
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.
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200720155530.1173732-19-a.darwish@linutronix.de
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r-- | include/linux/dcache.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index a81f0c3cf352..65d975bf9390 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -89,7 +89,7 @@ extern struct dentry_stat_t dentry_stat; struct dentry { /* RCU lookup touched fields */ unsigned int d_flags; /* protected by d_lock */ - seqcount_t d_seq; /* per dentry seqlock */ + seqcount_spinlock_t d_seq; /* per dentry seqlock */ struct hlist_bl_node d_hash; /* lookup hash list */ struct dentry *d_parent; /* parent directory */ struct qstr d_name; |