[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1356e5b9-44f0-4ccb-9e82-48c924495b93@linux.alibaba.com>
Date: Tue, 7 Jan 2025 12:53:24 +0800
From: Jingbo Xu <jefflexu@...ux.alibaba.com>
To: Ferry Meng <mengferry@...ux.alibaba.com>,
"Michael S . Tsirkin" <mst@...hat.com>, Jason Wang <jasowang@...hat.com>,
linux-block@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
virtualization@...ts.linux.dev
Cc: linux-kernel@...r.kernel.org, io-uring@...r.kernel.org,
Stefan Hajnoczi <stefanha@...hat.com>, Christoph Hellwig
<hch@...radead.org>, Joseph Qi <joseph.qi@...ux.alibaba.com>
Subject: Re: [PATCH v1 1/3] virtio-blk: add virtio-blk chardev support.
On 12/18/24 5:24 PM, Ferry Meng wrote:
> +static int virtblk_cdev_add(struct virtio_blk *vblk,
> + const struct file_operations *fops)
@fops argument is not necessary, as currently virtblk_chr_fops is the
only valid value.
> @@ -1690,7 +1770,9 @@ static void __exit virtio_blk_fini(void)
> {
> unregister_virtio_driver(&virtio_blk);
> unregister_blkdev(major, "virtblk");
> + unregister_chrdev_region(vd_chr_devt, VIRTBLK_MINORS);
Better to call "unregister_chrdev_region(vd_chr_devt, VIRTBLK_MINORS)"
before "unregister_blkdev(major, "virtblk")" to follow the convention
that the order of the cleanup routine is exactly the reverse of that of
the init routine.
> destroy_workqueue(virtblk_wq);
> + ida_destroy(&vd_chr_minor_ida);
> }
> module_init(virtio_blk_init);
> module_exit(virtio_blk_fini);
--
Thanks,
Jingbo
Powered by blists - more mailing lists