Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5177ec7 authored by Michal Hocko's avatar Michal Hocko Committed by Paul E. McKenney
Browse files

rcu: Not necessary to pass rcu_read_lock_held() to rcu_dereference_protected()



Since ca5ecddf (rcu: define __rcu address space modifier for sparse)
rcu_dereference_check() use rcu_read_lock_held() as a part of condition
automatically.  Therefore, callers of rcu_dereference_check() no longer
need to pass rcu_read_lock_held() to rcu_dereference_check().

Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent e4cc1f22
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -48,13 +48,11 @@ checking of rcu_dereference() primitives:
		value of the pointer itself, for example, against NULL.
		value of the pointer itself, for example, against NULL.


The rcu_dereference_check() check expression can be any boolean
The rcu_dereference_check() check expression can be any boolean
expression, but would normally include one of the rcu_read_lock_held()
expression, but would normally include a lockdep expression.  However,
family of functions and a lockdep expression.  However, any boolean
any boolean expression can be used.  For a moderately ornate example,
expression can be used.  For a moderately ornate example, consider
consider the following:
the following:


	file = rcu_dereference_check(fdt->fd[fd],
	file = rcu_dereference_check(fdt->fd[fd],
				     rcu_read_lock_held() ||
				     lockdep_is_held(&files->file_lock) ||
				     lockdep_is_held(&files->file_lock) ||
				     atomic_read(&files->count) == 1);
				     atomic_read(&files->count) == 1);


@@ -62,7 +60,7 @@ This expression picks up the pointer "fdt->fd[fd]" in an RCU-safe manner,
and, if CONFIG_PROVE_RCU is configured, verifies that this expression
and, if CONFIG_PROVE_RCU is configured, verifies that this expression
is used in:
is used in:


1.	An RCU read-side critical section, or
1.	An RCU read-side critical section (implicit), or
2.	with files->file_lock held, or
2.	with files->file_lock held, or
3.	on an unshared files_struct.
3.	on an unshared files_struct.