Skip to content

Commit 3afd801

Browse files
committed
ftrace: Rename dup_hash() and comment it
The name "dup_hash()" is a misnomer as it does not duplicate the hash that is passed in, but instead moves its entities from that hash to a newly allocated one. Rename it to "__move_hash()" (using starting underscores as it is an internal function), and add some comments about what it does. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Acked-by: Mark Rutland <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 5efe968 commit 3afd801

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kernel/trace/ftrace.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,11 @@ ftrace_hash_rec_enable_modify(struct ftrace_ops *ops, int filter_hash);
13921392
static int ftrace_hash_ipmodify_update(struct ftrace_ops *ops,
13931393
struct ftrace_hash *new_hash);
13941394

1395-
static struct ftrace_hash *dup_hash(struct ftrace_hash *src, int size)
1395+
/*
1396+
* Allocate a new hash and remove entries from @src and move them to the new hash.
1397+
* On success, the @src hash will be empty and should be freed.
1398+
*/
1399+
static struct ftrace_hash *__move_hash(struct ftrace_hash *src, int size)
13961400
{
13971401
struct ftrace_func_entry *entry;
13981402
struct ftrace_hash *new_hash;
@@ -1439,7 +1443,7 @@ __ftrace_hash_move(struct ftrace_hash *src)
14391443
if (ftrace_hash_empty(src))
14401444
return EMPTY_HASH;
14411445

1442-
return dup_hash(src, size);
1446+
return __move_hash(src, size);
14431447
}
14441448

14451449
static int

0 commit comments

Comments
 (0)