Whamcloud - gitweb
LU-17848 osd: dt_tunables_fini() and friends return void 18/59418/3
authorTimothy Day <timday@amazon.com>
Sun, 25 May 2025 05:37:19 +0000 (01:37 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Jun 2025 06:36:45 +0000 (06:36 +0000)
The function dt_tunables_fini() can't really fail. Make
it return void. Make the various osd_procfs_fini()
implementations also return void.

Test-Parameters: trivial
Test-Parameters: trivial fstype=zfs
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I5edc7ed43fad69d6ebdd734d8e9fdc69cdcf0915
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59418
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lijing Chen <lijinc@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/dt_object.h
lustre/obdclass/dt_object.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_handler.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_lproc.c

index 398f788..c3b05b0 100644 (file)
@@ -3118,6 +3118,6 @@ int dt_global_init(void);
 void dt_global_fini(void);
 int dt_tunables_init(struct dt_device *dt, struct obd_type *type,
                     const char *name, struct ldebugfs_vars *list);
-int dt_tunables_fini(struct dt_device *dt);
+void dt_tunables_fini(struct dt_device *dt);
 
 #endif /* __LUSTRE_DT_OBJECT_H */
index eb6f4e5..10956de 100644 (file)
@@ -1264,18 +1264,16 @@ static void dt_sysfs_release(struct kobject *kobj)
        complete(&dt->dd_kobj_unregister);
 }
 
-int dt_tunables_fini(struct dt_device *dt)
+void dt_tunables_fini(struct dt_device *dt)
 {
        if (!dt)
-               return -EINVAL;
+               return;
 
        if (dt->dd_def_attrs) {
                sysfs_remove_files(&dt->dd_kobj, dt->dd_def_attrs);
                kobject_put(&dt->dd_kobj);
                wait_for_completion(&dt->dd_kobj_unregister);
        }
-
-       return 0;
 }
 EXPORT_SYMBOL(dt_tunables_fini);
 
index 70d959b..e8af0f9 100644 (file)
@@ -817,7 +817,7 @@ static inline char *osd_oid_name(char *name, size_t name_size,
 /* osd_lproc.c */
 extern struct lprocfs_vars lprocfs_osd_obd_vars[];
 int osd_procfs_init(struct osd_device *osd, const char *name);
-int osd_procfs_fini(struct osd_device *osd);
+void osd_procfs_fini(struct osd_device *osd);
 void osd_brw_stats_update(struct osd_device *osd, struct osd_iobuf *iobuf);
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 52, 0)
 int osd_register_proc_index_in_idif(struct osd_device *osd);
index 6419d3d..f458c48 100644 (file)
@@ -891,7 +891,7 @@ out:
        return rc;
 }
 
-int osd_procfs_fini(struct osd_device *osd)
+void osd_procfs_fini(struct osd_device *osd)
 {
        lprocfs_fini_brw_stats(&osd->od_brw_stats);
 
@@ -901,5 +901,5 @@ int osd_procfs_fini(struct osd_device *osd)
        if (osd->od_proc_entry)
                lprocfs_remove(&osd->od_proc_entry);
 
-       return dt_tunables_fini(&osd->od_dt_dev);
+       dt_tunables_fini(&osd->od_dt_dev);
 }
index 8fae9f9..1853b4c 100644 (file)
@@ -1311,7 +1311,6 @@ static struct lu_device *osd_device_fini(const struct lu_env *env,
                                         struct lu_device *d)
 {
        struct osd_device *o = osd_dev(d);
-       int rc;
 
        ENTRY;
        osd_index_backup(env, o, false);
@@ -1327,12 +1326,7 @@ static struct lu_device *osd_device_fini(const struct lu_env *env,
        /* now with all the callbacks completed we can cleanup the remainings */
        osd_shutdown(env, o);
        osd_scrub_cleanup(env, o);
-
-       rc = osd_procfs_fini(o);
-       if (rc) {
-               CERROR("proc fini error %d\n", rc);
-               RETURN(ERR_PTR(rc));
-       }
+       osd_procfs_fini(o);
 
        if (o->od_os)
                osd_umount(env, o);
index 66f0721..b652598 100644 (file)
@@ -615,7 +615,7 @@ extern struct kmem_cache *osd_zapit_cachep;
 extern struct lprocfs_vars lprocfs_osd_obd_vars[];
 
 int osd_procfs_init(struct osd_device *osd, const char *name);
-int osd_procfs_fini(struct osd_device *osd);
+void osd_procfs_fini(struct osd_device *osd);
 
 /* osd_object.c */
 extern char *osd_obj_tag;
index 0e8703a..78447c2 100644 (file)
@@ -437,7 +437,7 @@ out:
        return rc;
 }
 
-int osd_procfs_fini(struct osd_device *osd)
+void osd_procfs_fini(struct osd_device *osd)
 {
        ENTRY;
 
@@ -451,5 +451,5 @@ int osd_procfs_fini(struct osd_device *osd)
                osd->od_proc_entry = NULL;
        }
 
-       return dt_tunables_fini(&osd->od_dt_dev);
+       dt_tunables_fini(&osd->od_dt_dev);
 }