Skip to content

Commit 93f6d4e

Browse files
committed
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
1 parent 555bb4c commit 93f6d4e

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

fs/dcache.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,15 +2597,7 @@ EXPORT_SYMBOL(d_rehash);
25972597

25982598
static inline unsigned start_dir_add(struct inode *dir)
25992599
{
2600-
/*
2601-
* The caller holds a spinlock (dentry::d_lock). On !PREEMPT_RT
2602-
* kernels spin_lock() implicitly disables preemption, but not on
2603-
* PREEMPT_RT. So for RT it has to be done explicitly to protect
2604-
* the sequence count write side critical section against a reader
2605-
* or another writer preempting, which would result in a live lock.
2606-
*/
2607-
if (IS_ENABLED(CONFIG_PREEMPT_RT))
2608-
preempt_disable();
2600+
preempt_disable_nested();
26092601
for (;;) {
26102602
unsigned n = dir->i_dir_seq;
26112603
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,
26182610
wait_queue_head_t *d_wait)
26192611
{
26202612
smp_store_release(&dir->i_dir_seq, n + 2);
2621-
if (IS_ENABLED(CONFIG_PREEMPT_RT))
2622-
preempt_enable();
2613+
preempt_enable_nested();
26232614
wake_up_all(d_wait);
26242615
}
26252616

0 commit comments

Comments
 (0)