From: Timothy Day Date: Sun, 25 May 2025 05:37:19 +0000 (-0400) Subject: LU-17848 osd: dt_tunables_fini() and friends return void X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e53f207ab4c1b366936ca883e0bb3ff60e8c7a02;p=fs%2Flustre-release.git LU-17848 osd: dt_tunables_fini() and friends return void 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 Change-Id: I5edc7ed43fad69d6ebdd734d8e9fdc69cdcf0915 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59418 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Lijing Chen Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 398f788..c3b05b0 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -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 */ diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index eb6f4e5..10956de 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -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); diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index 70d959b..e8af0f9 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -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); diff --git a/lustre/osd-ldiskfs/osd_lproc.c b/lustre/osd-ldiskfs/osd_lproc.c index 6419d3d..f458c48 100644 --- a/lustre/osd-ldiskfs/osd_lproc.c +++ b/lustre/osd-ldiskfs/osd_lproc.c @@ -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); } diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index 8fae9f9..1853b4c 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -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); diff --git a/lustre/osd-zfs/osd_internal.h b/lustre/osd-zfs/osd_internal.h index 66f0721..b652598 100644 --- a/lustre/osd-zfs/osd_internal.h +++ b/lustre/osd-zfs/osd_internal.h @@ -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; diff --git a/lustre/osd-zfs/osd_lproc.c b/lustre/osd-zfs/osd_lproc.c index 0e8703a..78447c2 100644 --- a/lustre/osd-zfs/osd_lproc.c +++ b/lustre/osd-zfs/osd_lproc.c @@ -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); }