]> www.infradead.org Git - users/hch/misc.git/commit
nvmet-fcloop: allocate/free fcloop_lsreq directly
authorDaniel Wagner <wagi@kernel.org>
Wed, 7 May 2025 12:23:05 +0000 (14:23 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 12 May 2025 14:04:04 +0000 (16:04 +0200)
commit6dbe553285c3b55cf4110b5188e8efa11852b2f0
treedcbfc9f4d497dcd47b5658db61c866b4f089a6a2
parentb190612016292d97cb6b03f303dc8337dfbd377c
nvmet-fcloop: allocate/free fcloop_lsreq directly

fcloop depends on the host or the target to allocate the fcloop_lsreq
object. This means that the lifetime of the fcloop_lsreq is tied to
either the host or the target. Consequently, the host or the target must
cooperate during shutdown.

Unfortunately, this approach does not work well when the target forces a
shutdown, as there are dependencies that are difficult to resolve in a
clean way.

The simplest solution is to decouple the lifetime of the fcloop_lsreq
object by managing them directly within fcloop. Since this is not a
performance-critical path and only a small number of LS objects are used
during setup and cleanup, it does not significantly impact performance
to allocate them during normal operation.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fcloop.c