io_uring/filetable: remove io_file_from_index() helper
authorJens Axboe <axboe@kernel.dk>
Mon, 28 Oct 2024 14:35:05 +0000 (08:35 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 2 Nov 2024 21:45:30 +0000 (15:45 -0600)
It's only used in fdinfo, nothing really gained from having this helper.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/fdinfo.c
io_uring/filetable.h

index e3f5e9fe556245a693e933b8fbe7967a4973fff8..9d96481e2eb60c265e02436f3e4ff18e75180ffd 100644 (file)
@@ -167,8 +167,10 @@ __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *file)
        seq_printf(m, "SqWorkTime:\t%llu\n", sq_work_time);
        seq_printf(m, "UserFiles:\t%u\n", ctx->file_table.data.nr);
        for (i = 0; has_lock && i < ctx->file_table.data.nr; i++) {
-               struct file *f = io_file_from_index(&ctx->file_table, i);
+               struct file *f = NULL;
 
+               if (ctx->file_table.data.nodes[i])
+                       f = io_slot_file(ctx->file_table.data.nodes[i]);
                if (f)
                        seq_printf(m, "%5u: %s\n", i, file_dentry(f)->d_iname);
                else
index 29edda0caa65c5afe6afed3004e0213c371b50f1..6c0c9642f6e9916ea0168deb7dc41ef7e4e2e0d1 100644 (file)
@@ -49,16 +49,6 @@ static inline struct file *io_slot_file(struct io_rsrc_node *node)
        return (struct file *)(node->file_ptr & FFS_MASK);
 }
 
-static inline struct file *io_file_from_index(struct io_file_table *table,
-                                             int index)
-{
-       struct io_rsrc_node *node = io_rsrc_node_lookup(&table->data, index);
-
-       if (node)
-               return io_slot_file(node);
-       return NULL;
-}
-
 static inline void io_fixed_file_set(struct io_rsrc_node *node,
                                     struct file *file)
 {