forked from mirrors/linux
		
	io_uring/uring_cmd: cleanup struct io_uring_cmd_data layout
A few spots in uring_cmd assume that the SQEs copied are always at the start of the structure, and hence mix req->async_data and the struct itself. Clean that up and use the proper indices. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
		
							parent
							
								
									d58d82bd0e
								
							
						
					
					
						commit
						eaf72f7b41
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -192,8 +192,8 @@ static int io_uring_cmd_prep_setup(struct io_kiocb *req,
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	memcpy(req->async_data, sqe, uring_sqe_size(req->ctx));
 | 
						memcpy(cache->sqes, sqe, uring_sqe_size(req->ctx));
 | 
				
			||||||
	ioucmd->sqe = req->async_data;
 | 
						ioucmd->sqe = cache->sqes;
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -260,7 +260,7 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags)
 | 
				
			||||||
		struct io_uring_cmd_data *cache = req->async_data;
 | 
							struct io_uring_cmd_data *cache = req->async_data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (ioucmd->sqe != (void *) cache)
 | 
							if (ioucmd->sqe != (void *) cache)
 | 
				
			||||||
			memcpy(cache, ioucmd->sqe, uring_sqe_size(req->ctx));
 | 
								memcpy(cache->sqes, ioucmd->sqe, uring_sqe_size(req->ctx));
 | 
				
			||||||
		return -EAGAIN;
 | 
							return -EAGAIN;
 | 
				
			||||||
	} else if (ret == -EIOCBQUEUED) {
 | 
						} else if (ret == -EIOCBQUEUED) {
 | 
				
			||||||
		return -EIOCBQUEUED;
 | 
							return -EIOCBQUEUED;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue