Whamcloud - gitweb
LU-17848 osd-zfs: use LU_TYPE_INIT_FINI() macro 09/55609/3
authorTimothy Day <timday@amazon.com>
Tue, 2 Jul 2024 23:27:02 +0000 (23:27 +0000)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Jul 2024 20:56:13 +0000 (20:56 +0000)
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 <timday@amazon.com>
Change-Id: I4117d1174bc7d07b184eb16d826452b075b04ea3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55609
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osd-zfs/osd_handler.c

index 35c9b43..30063cc 100644 (file)
@@ -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,