]> Git Repo - linux.git/commitdiff
blktrace: remove debugfs file dentries from struct blk_trace
authorGreg Kroah-Hartman <[email protected]>
Tue, 16 Feb 2021 15:52:47 +0000 (16:52 +0100)
committerJens Axboe <[email protected]>
Tue, 23 Feb 2021 16:54:51 +0000 (09:54 -0700)
These debugfs dentries do not need to be saved for anything as the whole
directory and everything in it is properly cleaned up when the parent
directory is removed.  So remove them from struct blk_trace and don't
save them when created as it's not necessary.

Cc: Jens Axboe <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
include/linux/blktrace_api.h
kernel/trace/blktrace.c

index e17d04abf6a3cf580f62c31cee2336caf50ce7e0..a083e15df60876d04944861b9518647d60a21845 100644 (file)
@@ -23,8 +23,6 @@ struct blk_trace {
        u32 pid;
        u32 dev;
        struct dentry *dir;
-       struct dentry *dropped_file;
-       struct dentry *msg_file;
        struct list_head running_list;
        atomic_t dropped;
 };
index d7ebef83771c5389a01dcb8ce013672116f2519b..0c8690d9f6cd0e0d07a80db4eeb84c3fd7c8437e 100644 (file)
@@ -311,8 +311,6 @@ record_it:
 
 static void blk_trace_free(struct blk_trace *bt)
 {
-       debugfs_remove(bt->msg_file);
-       debugfs_remove(bt->dropped_file);
        relay_close(bt->rchan);
        debugfs_remove(bt->dir);
        free_percpu(bt->sequence);
@@ -544,10 +542,8 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
        INIT_LIST_HEAD(&bt->running_list);
 
        ret = -EIO;
-       bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt,
-                                              &blk_dropped_fops);
-
-       bt->msg_file = debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
+       debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
+       debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 
        bt->rchan = relay_open("trace", dir, buts->buf_size,
                                buts->buf_nr, &blk_relay_callbacks, bt);
This page took 0.069356 seconds and 4 git commands to generate.