@@ -7028,33 +7028,6 @@ static void io_free_file_tables(struct io_file_table *table, unsigned nr_files)
7028
7028
table -> files = NULL ;
7029
7029
}
7030
7030
7031
- static void __io_sqe_files_unregister (struct io_ring_ctx * ctx )
7032
- {
7033
- #if defined(CONFIG_UNIX )
7034
- if (ctx -> ring_sock ) {
7035
- struct sock * sock = ctx -> ring_sock -> sk ;
7036
- struct sk_buff * skb ;
7037
-
7038
- while ((skb = skb_dequeue (& sock -> sk_receive_queue )) != NULL )
7039
- kfree_skb (skb );
7040
- }
7041
- #else
7042
- int i ;
7043
-
7044
- for (i = 0 ; i < ctx -> nr_user_files ; i ++ ) {
7045
- struct file * file ;
7046
-
7047
- file = io_file_from_index (ctx , i );
7048
- if (file )
7049
- fput (file );
7050
- }
7051
- #endif
7052
- io_free_file_tables (& ctx -> file_table , ctx -> nr_user_files );
7053
- kfree (ctx -> file_data );
7054
- ctx -> file_data = NULL ;
7055
- ctx -> nr_user_files = 0 ;
7056
- }
7057
-
7058
7031
static inline void io_rsrc_ref_lock (struct io_ring_ctx * ctx )
7059
7032
{
7060
7033
spin_lock_bh (& ctx -> rsrc_ref_lock );
@@ -7157,6 +7130,33 @@ static struct io_rsrc_data *io_rsrc_data_alloc(struct io_ring_ctx *ctx,
7157
7130
return data ;
7158
7131
}
7159
7132
7133
+ static void __io_sqe_files_unregister (struct io_ring_ctx * ctx )
7134
+ {
7135
+ #if defined(CONFIG_UNIX )
7136
+ if (ctx -> ring_sock ) {
7137
+ struct sock * sock = ctx -> ring_sock -> sk ;
7138
+ struct sk_buff * skb ;
7139
+
7140
+ while ((skb = skb_dequeue (& sock -> sk_receive_queue )) != NULL )
7141
+ kfree_skb (skb );
7142
+ }
7143
+ #else
7144
+ int i ;
7145
+
7146
+ for (i = 0 ; i < ctx -> nr_user_files ; i ++ ) {
7147
+ struct file * file ;
7148
+
7149
+ file = io_file_from_index (ctx , i );
7150
+ if (file )
7151
+ fput (file );
7152
+ }
7153
+ #endif
7154
+ io_free_file_tables (& ctx -> file_table , ctx -> nr_user_files );
7155
+ kfree (ctx -> file_data );
7156
+ ctx -> file_data = NULL ;
7157
+ ctx -> nr_user_files = 0 ;
7158
+ }
7159
+
7160
7160
static int io_sqe_files_unregister (struct io_ring_ctx * ctx )
7161
7161
{
7162
7162
int ret ;
0 commit comments