mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	nvme: consolidate common code from ->reset_work
No change in behavior except that the FC code cancels two work items a little later now. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
		
							parent
							
								
									e9bc25874c
								
							
						
					
					
						commit
						6cd53d14aa
					
				
					 4 changed files with 4 additions and 21 deletions
				
			
		|  | @ -102,7 +102,11 @@ static void nvme_delete_ctrl_work(struct work_struct *work) | ||||||
| 	struct nvme_ctrl *ctrl = | 	struct nvme_ctrl *ctrl = | ||||||
| 		container_of(work, struct nvme_ctrl, delete_work); | 		container_of(work, struct nvme_ctrl, delete_work); | ||||||
| 
 | 
 | ||||||
|  | 	nvme_stop_ctrl(ctrl); | ||||||
|  | 	nvme_remove_namespaces(ctrl); | ||||||
| 	ctrl->ops->delete_ctrl(ctrl); | 	ctrl->ops->delete_ctrl(ctrl); | ||||||
|  | 	nvme_uninit_ctrl(ctrl); | ||||||
|  | 	nvme_put_ctrl(ctrl); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int nvme_delete_ctrl(struct nvme_ctrl *ctrl) | int nvme_delete_ctrl(struct nvme_ctrl *ctrl) | ||||||
|  |  | ||||||
|  | @ -2640,24 +2640,11 @@ nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl) | ||||||
| 
 | 
 | ||||||
| 	cancel_work_sync(&ctrl->ctrl.reset_work); | 	cancel_work_sync(&ctrl->ctrl.reset_work); | ||||||
| 	cancel_delayed_work_sync(&ctrl->connect_work); | 	cancel_delayed_work_sync(&ctrl->connect_work); | ||||||
| 	nvme_stop_ctrl(&ctrl->ctrl); |  | ||||||
| 	nvme_remove_namespaces(&ctrl->ctrl); |  | ||||||
| 	/*
 | 	/*
 | ||||||
| 	 * kill the association on the link side.  this will block | 	 * kill the association on the link side.  this will block | ||||||
| 	 * waiting for io to terminate | 	 * waiting for io to terminate | ||||||
| 	 */ | 	 */ | ||||||
| 	nvme_fc_delete_association(ctrl); | 	nvme_fc_delete_association(ctrl); | ||||||
| 
 |  | ||||||
| 	/*
 |  | ||||||
| 	 * tear down the controller |  | ||||||
| 	 * After the last reference on the nvme ctrl is removed, |  | ||||||
| 	 * the transport nvme_fc_nvme_ctrl_freed() callback will be |  | ||||||
| 	 * invoked. From there, the transport will tear down it's |  | ||||||
| 	 * logical queues and association. |  | ||||||
| 	 */ |  | ||||||
| 	nvme_uninit_ctrl(&ctrl->ctrl); |  | ||||||
| 
 |  | ||||||
| 	nvme_put_ctrl(&ctrl->ctrl); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void | static void | ||||||
|  |  | ||||||
|  | @ -1757,11 +1757,7 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) | ||||||
| 
 | 
 | ||||||
| static void nvme_rdma_delete_ctrl(struct nvme_ctrl *ctrl) | static void nvme_rdma_delete_ctrl(struct nvme_ctrl *ctrl) | ||||||
| { | { | ||||||
| 	nvme_stop_ctrl(ctrl); |  | ||||||
| 	nvme_remove_namespaces(ctrl); |  | ||||||
| 	nvme_rdma_shutdown_ctrl(to_rdma_ctrl(ctrl), true); | 	nvme_rdma_shutdown_ctrl(to_rdma_ctrl(ctrl), true); | ||||||
| 	nvme_uninit_ctrl(ctrl); |  | ||||||
| 	nvme_put_ctrl(ctrl); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void nvme_rdma_reset_ctrl_work(struct work_struct *work) | static void nvme_rdma_reset_ctrl_work(struct work_struct *work) | ||||||
|  |  | ||||||
|  | @ -440,11 +440,7 @@ static void nvme_loop_shutdown_ctrl(struct nvme_loop_ctrl *ctrl) | ||||||
| 
 | 
 | ||||||
| static void nvme_loop_delete_ctrl_host(struct nvme_ctrl *ctrl) | static void nvme_loop_delete_ctrl_host(struct nvme_ctrl *ctrl) | ||||||
| { | { | ||||||
| 	nvme_stop_ctrl(ctrl); |  | ||||||
| 	nvme_remove_namespaces(ctrl); |  | ||||||
| 	nvme_loop_shutdown_ctrl(to_loop_ctrl(ctrl)); | 	nvme_loop_shutdown_ctrl(to_loop_ctrl(ctrl)); | ||||||
| 	nvme_uninit_ctrl(ctrl); |  | ||||||
| 	nvme_put_ctrl(ctrl); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void nvme_loop_delete_ctrl(struct nvmet_ctrl *nctrl) | static void nvme_loop_delete_ctrl(struct nvmet_ctrl *nctrl) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christoph Hellwig
						Christoph Hellwig