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

From: Steven Rostedt
Date: Tue Jan 30 2024 - 14:57:04 EST


On Tue, 30 Jan 2024 14:48:02 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> 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;
> }
>
>