From aa20d8b9218e6d5df4db9c6aafebc2ad4a8a4b1e Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Tue, 2 Jul 2024 23:27:02 +0000 Subject: [PATCH] LU-17848 osd-zfs: use LU_TYPE_INIT_FINI() macro Use LU_TYPE_INIT_FINI() macro rather than implementing the required functions manually. Test-Parameters: trivial Test-Parameters: trivial fstype=zfs Signed-off-by: Timothy Day Change-Id: I4117d1174bc7d07b184eb16d826452b075b04ea3 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55609 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger --- lustre/osd-zfs/osd_handler.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index 35c9b43..30063cc 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -736,20 +736,6 @@ static const struct dt_device_operations osd_dt_ops = { .dt_reserve_or_free_quota = osd_reserve_or_free_quota, }; -/* - * DMU OSD device type methods - */ -static int osd_type_init(struct lu_device_type *t) -{ - LU_CONTEXT_KEY_INIT(&osd_key); - return lu_context_key_register(&osd_key); -} - -static void osd_type_fini(struct lu_device_type *t) -{ - lu_context_key_degister(&osd_key); -} - static void *osd_key_init(const struct lu_context *ctx, struct lu_context_key *key) { @@ -1562,13 +1548,7 @@ const struct lu_device_operations osd_lu_ops = { .ldo_fid_alloc = fid_alloc_generic, }; -static void osd_type_start(struct lu_device_type *t) -{ -} - -static void osd_type_stop(struct lu_device_type *t) -{ -} +LU_TYPE_INIT_FINI(osd, &osd_key); static const struct lu_device_type_operations osd_device_type_ops = { .ldto_init = osd_type_init, -- 1.8.3.1