Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Ajay Kaher <akaher@vmware.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "shuah@kernel.org" <shuah@kernel.org>,
	"mhiramat@kernel.org" <mhiramat@kernel.org>,
	Ching-lin Yu <chinglinyu@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"linux-trace-kernel@vger.kernel.org" 
	<linux-trace-kernel@vger.kernel.org>,
	"lkp@intel.com" <lkp@intel.com>, Nadav Amit <namit@vmware.com>,
	"oe-lkp@lists.linux.dev" <oe-lkp@lists.linux.dev>,
	Alexey Makhalov <amakhalov@vmware.com>,
	"er.ajay.kaher@gmail.com" <er.ajay.kaher@gmail.com>,
	"srivatsa@csail.mit.edu" <srivatsa@csail.mit.edu>,
	Tapas Kundu <tkundu@vmware.com>,
	Vasavi Sirnapalli <vsirnapalli@vmware.com>
Subject: Re: [PATCH v5 02/10] eventfs: Implement tracefs_inode_cache
Date: Wed, 26 Jul 2023 18:45:34 +0000	[thread overview]
Message-ID: <0FE7065F-6536-4311-AF41-4ABBD8E3ECF8@vmware.com> (raw)
In-Reply-To: <20230725190617.14c85997@rorschach.local.home>


>> diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
>> index 57ac8aa4a724..2508944cc4d8 100644
>> --- a/fs/tracefs/inode.c
>> +++ b/fs/tracefs/inode.c
>> @@ -21,13 +21,33 @@
>> #include <linux/parser.h>
>> #include <linux/magic.h>
>> #include <linux/slab.h>
>> +#include "internal.h"
>> 
>> #define TRACEFS_DEFAULT_MODE 0700
>> +static struct kmem_cache *tracefs_inode_cachep __ro_after_init;
>> 
>> static struct vfsmount *tracefs_mount;
>> static int tracefs_mount_count;
>> static bool tracefs_registered;
>> 
>> +static struct inode *tracefs_alloc_inode(struct super_block *sb)
>> +{
>> +     struct tracefs_inode *ti;
>> +
>> +     ti = kmem_cache_alloc(tracefs_inode_cachep, GFP_KERNEL);
>> +     if (!ti)
>> +             return NULL;
>> +
>> +     ti->flags = 0;
>> +
>> +     return &ti->vfs_inode;
>> +}
>> +
>> +static void tracefs_free_inode(struct inode *inode)
>> +{
>> +     kmem_cache_free(tracefs_inode_cachep, get_tracefs(inode));
>> +}
>> +
>> static ssize_t default_read_file(struct file *file, char __user *buf,
>>                               size_t count, loff_t *ppos)
>> {
>> @@ -346,6 +366,9 @@ static int tracefs_show_options(struct seq_file *m, struct dentry *root)
>> }
>> 
>> static const struct super_operations tracefs_super_operations = {
>> +     .alloc_inode    = tracefs_alloc_inode,
>> +     .free_inode     = tracefs_free_inode,
>> +     .drop_inode     = generic_delete_inode,
>>      .statfs         = simple_statfs,
>>      .remount_fs     = tracefs_remount,
>>      .show_options   = tracefs_show_options,
>> @@ -628,10 +651,26 @@ bool tracefs_initialized(void)
>>      return tracefs_registered;
>> }
>> 
>> +static void init_once(void *foo)
>> +{
>> +     struct tracefs_inode *ti = (struct tracefs_inode *) foo;
>> +
>> +     inode_init_once(&ti->vfs_inode);
>> +}
>> +
>> static int __init tracefs_init(void)
>> {
>>      int retval;
>> 
>> +     tracefs_inode_cachep = kmem_cache_create("tracefs_inode_cache",
>> +                                              sizeof(struct tracefs_inode),
>> +                                              0, (SLAB_RECLAIM_ACCOUNT|
>> +                                                  SLAB_MEM_SPREAD|
>> +                                                  SLAB_ACCOUNT),
>> +                                              init_once);
>> +     if (!tracefs_inode_cachep)
>> +             return -ENOMEM;
>> +
>>      retval = sysfs_create_mount_point(kernel_kobj, "tracing");
>>      if (retval)
>>              return -EINVAL;
>> diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h
>> new file mode 100644
>> index 000000000000..49b5e8949e1c
>> --- /dev/null
>> +++ b/fs/tracefs/internal.h
>> @@ -0,0 +1,19 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _TRACEFS_INTERNAL_H
>> +#define _TRACEFS_INTERNAL_H
>> +
>> +enum {
>> +     TRACEFS_EVENT_INODE     = BIT(1),
>> +};
> 
> Let's not introduce the enum until it is used.


Ok, I will move this to v6 04/10.
Let me know once you will complete the review of v5.

-Ajay


  reply	other threads:[~2023-07-26 18:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-22 19:36 [PATCH v5 00/10] tracing: introducing eventfs Ajay Kaher
2023-07-22 19:36 ` [PATCH v5 01/10] tracing: Require all trace events to have a TRACE_SYSTEM Ajay Kaher
2023-07-22 19:36 ` [PATCH v5 02/10] eventfs: Implement tracefs_inode_cache Ajay Kaher
2023-07-25 23:06   ` Steven Rostedt
2023-07-26 18:45     ` Ajay Kaher [this message]
2023-07-26 21:39       ` Steven Rostedt
2023-07-22 19:36 ` [PATCH v5 03/10] tracefs: Rename and export some tracefs functions Ajay Kaher
2023-07-22 19:36 ` [PATCH v5 04/10] eventfs: Implement eventfs dir creation functions Ajay Kaher
2023-07-22 19:37 ` [PATCH v5 05/10] eventfs: Implement eventfs file add functions Ajay Kaher
2023-07-22 19:37 ` [PATCH v5 06/10] eventfs: Implement eventfs lookup, read, open functions Ajay Kaher
2023-07-26 20:28   ` Steven Rostedt
2023-07-26 20:51   ` Steven Rostedt
2023-07-22 19:37 ` [PATCH v5 07/10] eventfs: Implement functions to create files and dirs when accessed Ajay Kaher
2023-07-26 20:34   ` Steven Rostedt
2023-07-22 19:37 ` [PATCH v5 08/10] eventfs: Implement removal of meta data from eventfs Ajay Kaher
2023-07-22 19:37 ` [PATCH v5 09/10] eventfs: Move tracing/events to eventfs Ajay Kaher
2023-07-22 19:37 ` [PATCH v5 10/10] test: ftrace: Fix kprobe test for eventfs Ajay Kaher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0FE7065F-6536-4311-AF41-4ABBD8E3ECF8@vmware.com \
    --to=akaher@vmware.com \
    --cc=amakhalov@vmware.com \
    --cc=chinglinyu@google.com \
    --cc=er.ajay.kaher@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mhiramat@kernel.org \
    --cc=namit@vmware.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=srivatsa@csail.mit.edu \
    --cc=tkundu@vmware.com \
    --cc=vsirnapalli@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox