@@ -1165,19 +1165,20 @@ static struct smbdirect_recv_io *_get_first_reassembly(struct smbd_connection *i
1165
1165
*/
1166
1166
static struct smbdirect_recv_io * get_receive_buffer (struct smbd_connection * info )
1167
1167
{
1168
+ struct smbdirect_socket * sc = & info -> socket ;
1168
1169
struct smbdirect_recv_io * ret = NULL ;
1169
1170
unsigned long flags ;
1170
1171
1171
- spin_lock_irqsave (& info -> receive_queue_lock , flags );
1172
- if (!list_empty (& info -> receive_queue )) {
1172
+ spin_lock_irqsave (& sc -> recv_io . free . lock , flags );
1173
+ if (!list_empty (& sc -> recv_io . free . list )) {
1173
1174
ret = list_first_entry (
1174
- & info -> receive_queue ,
1175
+ & sc -> recv_io . free . list ,
1175
1176
struct smbdirect_recv_io , list );
1176
1177
list_del (& ret -> list );
1177
1178
info -> count_receive_queue -- ;
1178
1179
info -> count_get_receive_buffer ++ ;
1179
1180
}
1180
- spin_unlock_irqrestore (& info -> receive_queue_lock , flags );
1181
+ spin_unlock_irqrestore (& sc -> recv_io . free . lock , flags );
1181
1182
1182
1183
return ret ;
1183
1184
}
@@ -1202,11 +1203,11 @@ static void put_receive_buffer(
1202
1203
response -> sge .length = 0 ;
1203
1204
}
1204
1205
1205
- spin_lock_irqsave (& info -> receive_queue_lock , flags );
1206
- list_add_tail (& response -> list , & info -> receive_queue );
1206
+ spin_lock_irqsave (& sc -> recv_io . free . lock , flags );
1207
+ list_add_tail (& response -> list , & sc -> recv_io . free . list );
1207
1208
info -> count_receive_queue ++ ;
1208
1209
info -> count_put_receive_buffer ++ ;
1209
- spin_unlock_irqrestore (& info -> receive_queue_lock , flags );
1210
+ spin_unlock_irqrestore (& sc -> recv_io . free . lock , flags );
1210
1211
1211
1212
queue_work (info -> workqueue , & info -> post_send_credits_work );
1212
1213
}
@@ -1223,8 +1224,8 @@ static int allocate_receive_buffers(struct smbd_connection *info, int num_buf)
1223
1224
info -> reassembly_data_length = 0 ;
1224
1225
info -> reassembly_queue_length = 0 ;
1225
1226
1226
- INIT_LIST_HEAD (& info -> receive_queue );
1227
- spin_lock_init (& info -> receive_queue_lock );
1227
+ INIT_LIST_HEAD (& sc -> recv_io . free . list );
1228
+ spin_lock_init (& sc -> recv_io . free . lock );
1228
1229
info -> count_receive_queue = 0 ;
1229
1230
1230
1231
init_waitqueue_head (& info -> wait_receive_queues );
@@ -1236,16 +1237,16 @@ static int allocate_receive_buffers(struct smbd_connection *info, int num_buf)
1236
1237
1237
1238
response -> socket = sc ;
1238
1239
response -> sge .length = 0 ;
1239
- list_add_tail (& response -> list , & info -> receive_queue );
1240
+ list_add_tail (& response -> list , & sc -> recv_io . free . list );
1240
1241
info -> count_receive_queue ++ ;
1241
1242
}
1242
1243
1243
1244
return 0 ;
1244
1245
1245
1246
allocate_failed :
1246
- while (!list_empty (& info -> receive_queue )) {
1247
+ while (!list_empty (& sc -> recv_io . free . list )) {
1247
1248
response = list_first_entry (
1248
- & info -> receive_queue ,
1249
+ & sc -> recv_io . free . list ,
1249
1250
struct smbdirect_recv_io , list );
1250
1251
list_del (& response -> list );
1251
1252
info -> count_receive_queue -- ;
0 commit comments