@@ -69,9 +69,8 @@ checking of rcu_dereference() primitives:
69
69
value of the pointer itself, for example, against NULL.
70
70
71
71
The rcu_dereference_check() check expression can be any boolean
72
- expression, but would normally include a lockdep expression. However,
73
- any boolean expression can be used. For a moderately ornate example,
74
- consider the following::
72
+ expression, but would normally include a lockdep expression. For a
73
+ moderately ornate example, consider the following::
75
74
76
75
file = rcu_dereference_check(fdt->fd[fd],
77
76
lockdep_is_held(&files->file_lock) ||
@@ -97,10 +96,10 @@ code, it could instead be written as follows::
97
96
atomic_read(&files->count) == 1);
98
97
99
98
This would verify cases #2 and #3 above, and furthermore lockdep would
100
- complain if this was used in an RCU read-side critical section unless one
101
- of these two cases held. Because rcu_dereference_protected() omits all
102
- barriers and compiler constraints, it generates better code than do the
103
- other flavors of rcu_dereference(). On the other hand, it is illegal
99
+ complain even if this was used in an RCU read-side critical section unless
100
+ one of these two cases held. Because rcu_dereference_protected() omits
101
+ all barriers and compiler constraints, it generates better code than do
102
+ the other flavors of rcu_dereference(). On the other hand, it is illegal
104
103
to use rcu_dereference_protected() if either the RCU-protected pointer
105
104
or the RCU-protected data that it points to can change concurrently.
106
105
0 commit comments