Skip to content

Commit 0529a7b

Browse files
committed
targets: nfs: implement ->deinit_queue()
Implement nfs target's ->deinit_queue() callback, and free nfs queue data in this callback. Reviewed-by: Ronnie Sahlberg <rsahlberg@whamcloud.com> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
1 parent a3363f2 commit 0529a7b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

targets/ublk.nfs.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,13 @@ static int nfs_init_queue(const struct ublksrv_queue *q,
388388
return 0;
389389
}
390390

391+
static void nfs_deinit_queue(const struct ublksrv_queue *q)
392+
{
393+
struct nfs_queue_data *data = nfs_get_queue_data(q);
394+
395+
free(data);
396+
}
397+
391398
static void nfs_cmd_usage()
392399
{
393400
printf("\t--nfs NFS-URL\n");
@@ -402,6 +409,7 @@ static const struct ublksrv_tgt_type nfs_tgt_type = {
402409
.ublksrv_flags = UBLKSRV_F_NEED_EVENTFD,
403410
.name = "nfs",
404411
.init_queue = nfs_init_queue,
412+
.deinit_queue = nfs_deinit_queue,
405413
};
406414

407415
int main(int argc, char *argv[])

0 commit comments

Comments
 (0)