lkml.org 
[lkml]   [2022]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] kernfs: Replace global kernfs_open_file_mutex with hashed mutexes.
On Thu, Apr 28, 2022 at 03:54:31PM +1000, Imran Khan wrote:
> +static void __init kernfs_mutex_init(void)
> +{
> + int count;
> +
> + for (count = 0; count < NR_KERNFS_LOCKS; count++)
> + mutex_init(&kernfs_locks->open_file_mutex[count]);
> +}

Does this need to be a separate function?

> +static void __init kernfs_lock_init(void)
> +{
> + kernfs_locks = kmalloc(sizeof(struct kernfs_global_locks), GFP_KERNEL);
> + WARN_ON(!kernfs_locks);
> +
> + kernfs_mutex_init();
> +}
> +
> void __init kernfs_init(void)
> {
> kernfs_node_cache = kmem_cache_create("kernfs_node_cache",

Other than that minor nitpick,

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

--
tejun

\
 
 \ /
  Last update: 2022-05-05 22:06    [W:0.152 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site