summary refs log tree commit diff
path: root/kernel/bpf/local_storage.c
diff options
context:
space:
mode:
authorKamalesh Babulal <kamalesh.babulal@oracle.com>2023-03-03 15:23:10 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-21 16:00:51 +0200
commit7a2e2ca9ad21c770398c1e6b6d63c93e40bc0cfe (patch)
tree8f7101bcaea64a66e67ab0e8b935fa45d12923f4 /kernel/bpf/local_storage.c
parent6111f0add6ffc93612d4abe9fec002319102b1c0 (diff)
downloadlinux-7a2e2ca9ad21c770398c1e6b6d63c93e40bc0cfe.tar.gz
cgroup: bpf: use cgroup_lock()/cgroup_unlock() wrappers
[ Upstream commit 4cdb91b0dea7d7f59fa84a13c7753cd434fdedcf ]

Replace mutex_[un]lock() with cgroup_[un]lock() wrappers to stay
consistent across cgroup core and other subsystem code, while
operating on the cgroup_mutex.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Stable-dep-of: 2bd110339288 ("cgroup: always put cset in cgroup_css_set_put_fork")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/bpf/local_storage.c')
-rw-r--r--kernel/bpf/local_storage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/local_storage.c b/kernel/bpf/local_storage.c
index 098cf336fae6..f01ca6f1ee03 100644
--- a/kernel/bpf/local_storage.c
+++ b/kernel/bpf/local_storage.c
@@ -333,14 +333,14 @@ static void cgroup_storage_map_free(struct bpf_map *_map)
 	struct list_head *storages = &map->list;
 	struct bpf_cgroup_storage *storage, *stmp;
 
-	mutex_lock(&cgroup_mutex);
+	cgroup_lock();
 
 	list_for_each_entry_safe(storage, stmp, storages, list_map) {
 		bpf_cgroup_storage_unlink(storage);
 		bpf_cgroup_storage_free(storage);
 	}
 
-	mutex_unlock(&cgroup_mutex);
+	cgroup_unlock();
 
 	WARN_ON(!RB_EMPTY_ROOT(&map->root));
 	WARN_ON(!list_empty(&map->list));