Skip to content

Commit cb1717a

Browse files
committed
io_uring/filetable: remove io_file_from_index() helper
It's only used in fdinfo, nothing really gained from having this helper. Signed-off-by: Jens Axboe <[email protected]>
1 parent b54a140 commit cb1717a

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

io_uring/fdinfo.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *file)
167167
seq_printf(m, "SqWorkTime:\t%llu\n", sq_work_time);
168168
seq_printf(m, "UserFiles:\t%u\n", ctx->file_table.data.nr);
169169
for (i = 0; has_lock && i < ctx->file_table.data.nr; i++) {
170-
struct file *f = io_file_from_index(&ctx->file_table, i);
170+
struct file *f = NULL;
171171

172+
if (ctx->file_table.data.nodes[i])
173+
f = io_slot_file(ctx->file_table.data.nodes[i]);
172174
if (f)
173175
seq_printf(m, "%5u: %s\n", i, file_dentry(f)->d_iname);
174176
else

io_uring/filetable.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@ static inline struct file *io_slot_file(struct io_rsrc_node *node)
4949
return (struct file *)(node->file_ptr & FFS_MASK);
5050
}
5151

52-
static inline struct file *io_file_from_index(struct io_file_table *table,
53-
int index)
54-
{
55-
struct io_rsrc_node *node = io_rsrc_node_lookup(&table->data, index);
56-
57-
if (node)
58-
return io_slot_file(node);
59-
return NULL;
60-
}
61-
6252
static inline void io_fixed_file_set(struct io_rsrc_node *node,
6353
struct file *file)
6454
{

0 commit comments

Comments
 (0)