Re: [PATCH 2/6] eventfsfs: initialize the tracefs inode properly

Steven Rostedt
2024-01-30T19:56:44Z

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;
> }
>
>