Skip to content

Commit

Permalink
keyring: Remove now-redundant smp_read_barrier_depends()
Browse files Browse the repository at this point in the history
Now that the associative-array library properly heads dependency chains,
the various smp_read_barrier_depends() calls in security/keys/keyring.c
are no longer needed.  This commit therefore removes them.

Signed-off-by: Paul E. McKenney <[email protected]>
Cc: David Howells <[email protected]>
Cc: "Serge E. Hallyn" <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Reviewed-by: James Morris <[email protected]>
  • Loading branch information
paulmck committed Dec 4, 2017
1 parent 4be2b04 commit d963007
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions security/keys/keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ static bool search_nested_keyrings(struct key *keyring,
* doesn't contain any keyring pointers.
*/
shortcut = assoc_array_ptr_to_shortcut(ptr);
smp_read_barrier_depends();
if ((shortcut->index_key[0] & ASSOC_ARRAY_FAN_MASK) != 0)
goto not_this_keyring;

Expand All @@ -723,8 +722,6 @@ static bool search_nested_keyrings(struct key *keyring,
}

node = assoc_array_ptr_to_node(ptr);
smp_read_barrier_depends();

ptr = node->slots[0];
if (!assoc_array_ptr_is_meta(ptr))
goto begin_node;
Expand All @@ -736,15 +733,13 @@ static bool search_nested_keyrings(struct key *keyring,
kdebug("descend");
if (assoc_array_ptr_is_shortcut(ptr)) {
shortcut = assoc_array_ptr_to_shortcut(ptr);
smp_read_barrier_depends();
ptr = READ_ONCE(shortcut->next_node);
BUG_ON(!assoc_array_ptr_is_node(ptr));
}
node = assoc_array_ptr_to_node(ptr);

begin_node:
kdebug("begin_node");
smp_read_barrier_depends();
slot = 0;
ascend_to_node:
/* Go through the slots in a node */
Expand Down Expand Up @@ -792,14 +787,12 @@ static bool search_nested_keyrings(struct key *keyring,

if (ptr && assoc_array_ptr_is_shortcut(ptr)) {
shortcut = assoc_array_ptr_to_shortcut(ptr);
smp_read_barrier_depends();
ptr = READ_ONCE(shortcut->back_pointer);
slot = shortcut->parent_slot;
}
if (!ptr)
goto not_this_keyring;
node = assoc_array_ptr_to_node(ptr);
smp_read_barrier_depends();
slot++;

/* If we've ascended to the root (zero backpointer), we must have just
Expand Down

0 comments on commit d963007

Please sign in to comment.