mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	io_uring/notif: refactor io_tx_ubuf_complete()
Flip the dec_and_test "if", that makes the function extension easier in the future. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/43939e2b04dff03bff5d7227c98afedf951227b3.1713185320.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
		
							parent
							
								
									686b56cbee
								
							
						
					
					
						commit
						7e58d0af5a
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
					@ -37,10 +37,11 @@ static void io_tx_ubuf_callback(struct sk_buff *skb, struct ubuf_info *uarg,
 | 
				
			||||||
			WRITE_ONCE(nd->zc_copied, true);
 | 
								WRITE_ONCE(nd->zc_copied, true);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (refcount_dec_and_test(&uarg->refcnt)) {
 | 
						if (!refcount_dec_and_test(&uarg->refcnt))
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	notif->io_task_work.func = io_notif_tw_complete;
 | 
						notif->io_task_work.func = io_notif_tw_complete;
 | 
				
			||||||
	__io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE);
 | 
						__io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx)
 | 
					struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue