Re: [PATCH v3] rust: block: set GenDisk block_device_operations.owner to THIS_MODULE
From: Andreas Hindborg
Date: Wed Sep 23 2026 - 16:24:06 EST
Hi Adarsh,
Adarsh Das <adarshdas950@xxxxxxxxx> writes:
> GenDiskBuilder left block_device_operations.owner NULL. Set owner from a
> const block_device_operations table using this_module::<M>() and update
> rnull to pass NullBlkModule.
>
> Add ModuleMetadata::THIS_MODULE and this_module() so the owner pointer is
> available in const context. Rebased on Alvins fix-fops-owner series [1].
>
> Link: https://lore.kernel.org/all/20260805192020.107601-1-adarshdas950@xxxxxxxxx/
>
We merged `LocalModule` [1]. Please use this feature to set the owner.
I don't think you need to move the operations vtable.
Best regards,
Andreas Hindborg
[1] https://lore.kernel.org/r/20260811-fix-fops-owner-v10-7-7e71776f9dbe@xxxxxxxxx