File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -230,15 +230,13 @@ void io_rsrc_node_switch(struct io_ring_ctx *ctx,
230
230
ctx -> rsrc_node = backup ;
231
231
}
232
232
233
- int io_rsrc_node_switch_start (struct io_ring_ctx * ctx )
233
+ int __io_rsrc_node_switch_start (struct io_ring_ctx * ctx )
234
234
{
235
- if (io_alloc_cache_empty (& ctx -> rsrc_node_cache )) {
236
- struct io_rsrc_node * node = kzalloc (sizeof (* node ), GFP_KERNEL );
235
+ struct io_rsrc_node * node = kzalloc (sizeof (* node ), GFP_KERNEL );
237
236
238
- if (!node )
239
- return - ENOMEM ;
240
- io_alloc_cache_put (& ctx -> rsrc_node_cache , & node -> cache );
241
- }
237
+ if (!node )
238
+ return - ENOMEM ;
239
+ io_alloc_cache_put (& ctx -> rsrc_node_cache , & node -> cache );
242
240
return 0 ;
243
241
}
244
242
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ void io_rsrc_put_tw(struct callback_head *cb);
69
69
void io_rsrc_node_ref_zero (struct io_rsrc_node * node );
70
70
void io_rsrc_put_work (struct work_struct * work );
71
71
void io_rsrc_node_destroy (struct io_ring_ctx * ctx , struct io_rsrc_node * ref_node );
72
- int io_rsrc_node_switch_start (struct io_ring_ctx * ctx );
72
+ int __io_rsrc_node_switch_start (struct io_ring_ctx * ctx );
73
73
struct io_rsrc_node * io_rsrc_node_alloc (struct io_ring_ctx * ctx );
74
74
int io_queue_rsrc_removal (struct io_rsrc_data * data , unsigned idx ,
75
75
struct io_rsrc_node * node , void * rsrc );
@@ -111,6 +111,13 @@ static inline int io_scm_file_account(struct io_ring_ctx *ctx,
111
111
return __io_scm_file_account (ctx , file );
112
112
}
113
113
114
+ static inline int io_rsrc_node_switch_start (struct io_ring_ctx * ctx )
115
+ {
116
+ if (unlikely (io_alloc_cache_empty (& ctx -> rsrc_node_cache )))
117
+ return __io_rsrc_node_switch_start (ctx );
118
+ return 0 ;
119
+ }
120
+
114
121
int io_register_files_update (struct io_ring_ctx * ctx , void __user * arg ,
115
122
unsigned nr_args );
116
123
int io_register_rsrc_update (struct io_ring_ctx * ctx , void __user * arg ,
You can’t perform that action at this time.
0 commit comments