History

uprobes: Use DEFINE_STATIC_PERCPU_RWSEM() to initialize dup_mmap_sem

Use DEFINE_STATIC_PERCPU_RWSEM() to initialize dup_mmap_sem.

Oleg Nesterov committed 7 years ago

Commit 2bf1acc1 parent 95bf33b1 file · +1 −3Browse files

Unified · Split

kernel/events/uprobes.c+1−3
@@ -46,7 +46,7 @@ static DEFINE_SPINLOCK(uprobes_treelock); /* serialize rbtree access */ · 45 unmodified lines
46static struct mutex uprobes_mmap_mutex[UPROBES_HASH_SZ];46static struct mutex uprobes_mmap_mutex[UPROBES_HASH_SZ];
47#define uprobes_mmap_hash(v) (&uprobes_mmap_mutex[((unsigned long)(v)) % UPROBES_HASH_SZ])47#define uprobes_mmap_hash(v) (&uprobes_mmap_mutex[((unsigned long)(v)) % UPROBES_HASH_SZ])
48 48
49static struct percpu_rw_semaphore dup_mmap_sem;49DEFINE_STATIC_PERCPU_RWSEM(dup_mmap_sem);
50 50
51/* Have a copy of original instruction */51/* Have a copy of original instruction */
52#define UPROBE_COPY_INSN 052#define UPROBE_COPY_INSN 0
@@ -2302,7 +2302,5 @@ void __init uprobes_init(void) · 2249 unmodified lines
2302 for (i = 0; i < UPROBES_HASH_SZ; i++)2302 for (i = 0; i < UPROBES_HASH_SZ; i++)
2303 mutex_init(&uprobes_mmap_mutex[i]);2303 mutex_init(&uprobes_mmap_mutex[i]);
2304 2304
2305 BUG_ON(percpu_init_rwsem(&dup_mmap_sem));
2306
2307 BUG_ON(register_die_notifier(&uprobe_exception_nb));2305 BUG_ON(register_die_notifier(&uprobe_exception_nb));
2308}2306}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t