summaryrefslogtreecommitdiff
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2022-08-25 18:41:25 +0200
committerThomas Gleixner <tglx@linutronix.de>2022-09-19 14:35:07 +0200
commit93f6d4e1893657f07ba3c9e2bfa74b355a0b32f9 (patch)
tree506ce516c4283c31d73ce3bfe4c649a14660c7e0 /fs/dcache.c
parent555bb4ccd1dd78d0263eae31629fe1fdd65c1fb5 (diff)
dentry: Use preempt_[dis|en]able_nested()
Replace the open coded CONFIG_PREEMPT_RT conditional preempt_disable/enable() with the new helper. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org> Link: https://lore.kernel.org/r/20220825164131.402717-3-bigeasy@linutronix.de
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index bb0c4d0038db..2ee8636016ee 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2597,15 +2597,7 @@ EXPORT_SYMBOL(d_rehash);
static inline unsigned start_dir_add(struct inode *dir)
{
- /*
- * The caller holds a spinlock (dentry::d_lock). On !PREEMPT_RT
- * kernels spin_lock() implicitly disables preemption, but not on
- * PREEMPT_RT. So for RT it has to be done explicitly to protect
- * the sequence count write side critical section against a reader
- * or another writer preempting, which would result in a live lock.
- */
- if (IS_ENABLED(CONFIG_PREEMPT_RT))
- preempt_disable();
+ preempt_disable_nested();
for (;;) {
unsigned n = dir->i_dir_seq;
if (!(n & 1) && cmpxchg(&dir->i_dir_seq, n, n + 1) == n)
@@ -2618,8 +2610,7 @@ static inline void end_dir_add(struct inode *dir, unsigned int n,
wait_queue_head_t *d_wait)
{
smp_store_release(&dir->i_dir_seq, n + 2);
- if (IS_ENABLED(CONFIG_PREEMPT_RT))
- preempt_enable();
+ preempt_enable_nested();
wake_up_all(d_wait);
}