lkml.org 
[lkml]   [2024]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] eventfsfs: initialize the tracefs inode properly
On Tue, 30 Jan 2024 14:48:02 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> The ti is allocated from fs/tracefs/inode.c that has:
>
> static struct inode *tracefs_alloc_inode(struct super_block *sb)
> {
> struct tracefs_inode *ti;
>
> ti = kmem_cache_alloc(tracefs_inode_cachep, GFP_KERNEL);

I could also just add __GFP_ZERO so that all of it is initialized to zero,
and then we don't need to assign NULL to any part of it.

-- Steve


> if (!ti)
> return NULL;
>
> ti->flags = 0;
>
> return &ti->vfs_inode;
> }
>
>

\
 
 \ /
  Last update: 2024-05-27 14:40    [W:0.050 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site