Skip to content

Commit c5e27b1

Browse files
igawkeithbusch
authored andcommitted
nvmet-fc: free queue and assoc directly
Neither struct nvmet_fc_tgt_queue nor struct nvmet_fc_tgt_assoc are data structure which are used in a RCU context. So there is no reason to delay the free operation. Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Daniel Wagner <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 4049dc9 commit c5e27b1

File tree

1 file changed

+2
-4
lines changed
  • drivers/nvme/target

1 file changed

+2
-4
lines changed

drivers/nvme/target/fc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ struct nvmet_fc_tgt_queue {
145145
struct list_head avail_defer_list;
146146
struct workqueue_struct *work_q;
147147
struct kref ref;
148-
struct rcu_head rcu;
149148
/* array of fcp_iods */
150149
struct nvmet_fc_fcp_iod fod[] __counted_by(sqsize);
151150
} __aligned(sizeof(unsigned long long));
@@ -169,7 +168,6 @@ struct nvmet_fc_tgt_assoc {
169168
struct nvmet_fc_tgt_queue *queues[NVMET_NR_QUEUES + 1];
170169
struct kref ref;
171170
struct work_struct del_work;
172-
struct rcu_head rcu;
173171
};
174172

175173

@@ -852,7 +850,7 @@ nvmet_fc_tgt_queue_free(struct kref *ref)
852850

853851
destroy_workqueue(queue->work_q);
854852

855-
kfree_rcu(queue, rcu);
853+
kfree(queue);
856854
}
857855

858856
static void
@@ -1185,8 +1183,8 @@ nvmet_fc_target_assoc_free(struct kref *ref)
11851183
dev_info(tgtport->dev,
11861184
"{%d:%d} Association freed\n",
11871185
tgtport->fc_target_port.port_num, assoc->a_id);
1188-
kfree_rcu(assoc, rcu);
11891186
nvmet_fc_tgtport_put(tgtport);
1187+
kfree(assoc);
11901188
}
11911189

11921190
static void

0 commit comments

Comments
 (0)