@@ -489,6 +489,15 @@ static inline void write_seqlock(seqlock_t *sl)
__raw_write_seqcount_begin(&sl->seqcount);
}
+static inline int try_write_seqlock(seqlock_t *sl)
+{
+ if (spin_trylock(&sl->lock)) {
+ __raw_write_seqcount_begin(&sl->seqcount);
+ return 1;
+ }
+ return 0;
+}
+
static inline void write_sequnlock(seqlock_t *sl)
{
__raw_write_seqcount_end(&sl->seqcount);
@@ -168,16 +168,8 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc)
return false;
}
#ifdef CONFIG_PREEMPT_RT
- if (spin_trylock(&qdisc->running.lock)) {
- seqcount_t *s = &qdisc->running.seqcount;
- /*
- * Variant of write_seqcount_t_begin() telling lockdep that a
- * trylock was attempted.
- */
- __raw_write_seqcount_begin(s);
- seqcount_acquire(&s->dep_map, 0, 1, _RET_IP_);
+ if (try_write_seqlock(&qdisc->running))
return true;
- }
return false;
#else
/* Variant of write_seqcount_begin() telling lockdep a trylock