From 76626d6c52b19b5cca04007c4b1656cc52a487c1 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Thu, 4 Jun 2020 16:27:44 -0500 Subject: [PATCH] LU-13344 all: Separate debugfs and procfs handling Linux 5.6 introduces proc_ops with v5.5-8862-gd56c0d45f0e2 proc: decouple proc from VFS with "struct proc_ops" Separate debugfs usage and procfs usage to prepare for the divergence of debugfs using file_operations and procfs using proc_ops HPE-bug-id: LUS-8589 Signed-off-by: Shaun Tancheff Change-Id: I1746e563b55a9e89f90ac01843c304fe6b690d8b Reviewed-on: https://review.whamcloud.com/37834 Reviewed-by: Petros Koutoupis Reviewed-by: Neil Brown Reviewed-by: James Simmons Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/fid/fid_internal.h | 4 ++-- lustre/fid/lproc_fid.c | 4 ++-- lustre/fld/fld_internal.h | 2 +- lustre/fld/lproc_fld.c | 2 +- lustre/include/dt_object.h | 2 +- lustre/include/lprocfs_status.h | 41 +++++++++++++++++++++++++++++++++------- lustre/include/obd.h | 1 + lustre/include/obd_class.h | 2 +- lustre/ldlm/ldlm_internal.h | 2 +- lustre/ldlm/ldlm_pool.c | 4 ++-- lustre/ldlm/ldlm_resource.c | 2 +- lustre/llite/lproc_llite.c | 8 ++++---- lustre/lod/lproc_lod.c | 2 +- lustre/mdd/mdd_lproc.c | 6 +++--- lustre/mdt/mdt_coordinator.c | 6 ++---- lustre/mgc/lproc_mgc.c | 4 ++-- lustre/obdclass/dt_object.c | 2 +- lustre/obdclass/genops.c | 2 +- lustre/obdclass/lprocfs_status.c | 27 ++++++++++++++++++-------- lustre/osd-ldiskfs/osd_lproc.c | 4 ++-- lustre/osd-zfs/osd_lproc.c | 4 ++-- lustre/osp/lproc_osp.c | 12 ++++++------ lustre/ptlrpc/gss/lproc_gss.c | 4 ++-- lustre/ptlrpc/lproc_ptlrpc.c | 12 ++++++------ lustre/ptlrpc/nrs_crr.c | 2 +- lustre/ptlrpc/nrs_delay.c | 2 +- lustre/ptlrpc/nrs_orr.c | 4 ++-- lustre/ptlrpc/nrs_tbf.c | 2 +- lustre/ptlrpc/sec_lproc.c | 12 ++++++------ 29 files changed, 109 insertions(+), 72 deletions(-) diff --git a/lustre/fid/fid_internal.h b/lustre/fid/fid_internal.h index 1535ab0..4be0f04 100644 --- a/lustre/fid/fid_internal.h +++ b/lustre/fid/fid_internal.h @@ -55,7 +55,7 @@ enum { extern struct lu_context_key seq_thread_key; -extern struct lprocfs_vars seq_server_debugfs_list[]; +extern struct ldebugfs_vars seq_server_debugfs_list[]; /* Store API functions. */ struct dt_device; @@ -89,7 +89,7 @@ int seq_client_alloc_super(struct lu_client_seq *seq, extern struct dentry *seq_debugfs_dir; -extern struct lprocfs_vars seq_client_debugfs_list[]; +extern struct ldebugfs_vars seq_client_debugfs_list[]; extern const struct file_operations seq_fld_debugfs_seq_fops; diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c index 688082e..df896be 100644 --- a/lustre/fid/lproc_fid.c +++ b/lustre/fid/lproc_fid.c @@ -199,7 +199,7 @@ LDEBUGFS_SEQ_FOPS(ldebugfs_server_fid_space); LDEBUGFS_SEQ_FOPS(ldebugfs_server_fid_width); LDEBUGFS_SEQ_FOPS_RO(ldebugfs_server_fid_server); -struct lprocfs_vars seq_server_debugfs_list[] = { +struct ldebugfs_vars seq_server_debugfs_list[] = { { .name = "space", .fops = &ldebugfs_server_fid_space_fops }, { .name = "width", @@ -608,7 +608,7 @@ LDEBUGFS_SEQ_FOPS(ldebugfs_client_fid_width); LDEBUGFS_SEQ_FOPS_RO(ldebugfs_client_fid_server); LDEBUGFS_SEQ_FOPS_RO(ldebugfs_client_fid_fid); -struct lprocfs_vars seq_client_debugfs_list[] = { +struct ldebugfs_vars seq_client_debugfs_list[] = { { .name = "space", .fops = &ldebugfs_client_fid_space_fops }, { .name = "width", diff --git a/lustre/fld/fld_internal.h b/lustre/fld/fld_internal.h index b8e9590..53b8fc3 100644 --- a/lustre/fld/fld_internal.h +++ b/lustre/fld/fld_internal.h @@ -179,7 +179,7 @@ int fld_client_rpc(struct obd_export *exp, struct lu_seq_range *range, __u32 fld_op, struct ptlrpc_request **reqp); -extern struct lprocfs_vars fld_client_debugfs_list[]; +extern struct ldebugfs_vars fld_client_debugfs_list[]; struct fld_cache *fld_cache_init(const char *name, int cache_size, int cache_threshold); diff --git a/lustre/fld/lproc_fld.c b/lustre/fld/lproc_fld.c index 5edc90d..80f0ae4 100644 --- a/lustre/fld/lproc_fld.c +++ b/lustre/fld/lproc_fld.c @@ -135,7 +135,7 @@ LDEBUGFS_SEQ_FOPS_RO(fld_debugfs_targets); LDEBUGFS_SEQ_FOPS(fld_debugfs_hash); LDEBUGFS_FOPS_WR_ONLY(fld, cache_flush); -struct lprocfs_vars fld_client_debugfs_list[] = { +struct ldebugfs_vars fld_client_debugfs_list[] = { { .name = "targets", .fops = &fld_debugfs_targets_fops }, { .name = "hash", diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 752ac11..fe778cf 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -2941,7 +2941,7 @@ static inline struct dt_thread_info *dt_info(const struct lu_env *env) 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 lprocfs_vars *list); + const char *name, struct ldebugfs_vars *list); int dt_tunables_fini(struct dt_device *dt); # ifdef CONFIG_PROC_FS diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index 55af6cd..8611349 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -49,13 +49,25 @@ #include #include +/* + * Liuux 5.6 introduces proc_ops with v5.5-8862-gd56c0d45f0e2 + * Now that proc and debugfs use separate operation vector types + * separate containers are also needed. + */ struct lprocfs_vars { const char *name; const struct file_operations *fops; void *data; - /** - * /proc file mode. - */ + /** /proc file mode. */ + mode_t proc_mode; +}; + +/** Provide a debugfs container */ +struct ldebugfs_vars { + const char *name; + const struct file_operations *fops; + void *data; + /** debugfs file mode. */ mode_t proc_mode; }; @@ -521,13 +533,17 @@ lprocfs_nid_stats_clear_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off); extern int lprocfs_nid_stats_clear_seq_show(struct seq_file *file, void *data); #endif -extern const struct file_operations lprocfs_stats_seq_fops; extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name, - struct lprocfs_stats *stats); + struct lprocfs_stats *stats); +extern const struct file_operations ldebugfs_stats_seq_fops; /* lprocfs_status.c */ -extern void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *var, +extern void ldebugfs_add_vars(struct dentry *parent, struct ldebugfs_vars *var, void *data); +extern struct dentry *ldebugfs_register(const char *name, + struct dentry *parent, + struct ldebugfs_vars *list, + void *data); extern int lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *var, void *data); @@ -582,8 +598,15 @@ ssize_t ping_show(struct kobject *kobj, struct attribute *attr, char *buffer); extern ssize_t +ldebugfs_import_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off); +static inline ssize_t lprocfs_import_seq_write(struct file *file, const char __user *buffer, - size_t count, loff_t *off); + size_t count, loff_t *off) +{ + return ldebugfs_import_seq_write(file, buffer, count, off); +} + extern int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *data); extern ssize_t lprocfs_pinger_recov_seq_write(struct file *file, const char __user *buffer, @@ -972,6 +995,10 @@ lprocfs_ping_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { return 0; } static inline ssize_t +ldebugfs_import_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) +{ return 0; } +static inline ssize_t lprocfs_import_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { return 0; } diff --git a/lustre/include/obd.h b/lustre/include/obd.h index c0d70c6..e72ec06 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -733,6 +733,7 @@ struct obd_device { struct lprocfs_stats *obd_svc_stats; const struct attribute **obd_attrs; struct lprocfs_vars *obd_vars; + struct ldebugfs_vars *obd_debugfs_vars; atomic_t obd_evict_inprogress; wait_queue_head_t obd_evict_inprogress_waitq; struct list_head obd_evict_list; /* protected with pet_lock */ diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 6e68c1e..afb71e7 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -74,7 +74,7 @@ struct obd_type *class_add_symlinks(const char *name, bool enable_proc); #endif int class_register_type(const struct obd_ops *dt_ops, const struct md_ops *md_ops, bool enable_proc, - struct lprocfs_vars *module_vars, + struct ldebugfs_vars *module_vars, const char *nm, struct lu_device_type *ldt); int class_unregister_type(const char *nm); diff --git a/lustre/ldlm/ldlm_internal.h b/lustre/ldlm/ldlm_internal.h index be72ad1..2a6bf95 100644 --- a/lustre/ldlm/ldlm_internal.h +++ b/lustre/ldlm/ldlm_internal.h @@ -353,7 +353,7 @@ enum ldlm_policy_res { struct __##var##__dummy_write {; } /* semicolon catcher */ static inline void -ldlm_add_var(struct lprocfs_vars *vars, struct dentry *debugfs_entry, +ldlm_add_var(struct ldebugfs_vars *vars, struct dentry *debugfs_entry, const char *name, void *data, const struct file_operations *ops) { vars->name = name; diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index 402d5e0..e59c77c 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -788,7 +788,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl) { struct ldlm_namespace *ns = ldlm_pl2ns(pl); struct dentry *debugfs_ns_parent; - struct lprocfs_vars pool_vars[2]; + struct ldebugfs_vars pool_vars[2]; int rc = 0; ENTRY; @@ -845,7 +845,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl) LPROCFS_CNTR_AVGMINMAX | LPROCFS_CNTR_STDDEV, "recalc_timing", "sec"); debugfs_create_file("stats", 0644, pl->pl_debugfs_entry, - pl->pl_stats, &lprocfs_stats_seq_fops); + pl->pl_stats, &ldebugfs_stats_seq_fops); EXIT; out: diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index a154d85..26a2b08 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -207,7 +207,7 @@ static const struct file_operations ldlm_granted_fops = { #endif /* HAVE_SERVER_SUPPORT */ -static struct lprocfs_vars ldlm_debugfs_list[] = { +static struct ldebugfs_vars ldlm_debugfs_list[] = { { .name = "dump_namespaces", .fops = &ldlm_dump_ns_fops, .proc_mode = 0222 }, diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 79f352f..6ab8e5a 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -1463,9 +1463,9 @@ out_free_kernbuff: OBD_FREE(kernbuf, count + 1); return rc ? rc : count; } -LPROC_SEQ_FOPS(ll_pcc); +LDEBUGFS_SEQ_FOPS(ll_pcc); -struct lprocfs_vars lprocfs_llite_obd_vars[] = { +struct ldebugfs_vars lprocfs_llite_obd_vars[] = { { .name = "site", .fops = &ll_site_stats_fops }, { .name = "max_cached_mb", @@ -1673,7 +1673,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name) } debugfs_create_file("stats", 0644, sbi->ll_debugfs_entry, - sbi->ll_stats, &lprocfs_stats_seq_fops); + sbi->ll_stats, &ldebugfs_stats_seq_fops); sbi->ll_ra_stats = lprocfs_alloc_stats(ARRAY_SIZE(ra_stat_string), LPROCFS_STATS_FLAG_NONE); @@ -1685,7 +1685,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name) ra_stat_string[id], "pages"); debugfs_create_file("read_ahead_stats", 0644, sbi->ll_debugfs_entry, - sbi->ll_ra_stats, &lprocfs_stats_seq_fops); + sbi->ll_ra_stats, &ldebugfs_stats_seq_fops); out_ll_kset: /* Yes we also register sysfs mount kset here as well */ diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c index c4a4572..578305f 100644 --- a/lustre/lod/lproc_lod.c +++ b/lustre/lod/lproc_lod.c @@ -1075,7 +1075,7 @@ static struct attribute *lod_attrs[] = { */ int lod_procfs_init(struct lod_device *lod) { - struct lprocfs_vars ldebugfs_obd_vars[] = { { NULL } }; + struct ldebugfs_vars ldebugfs_obd_vars[] = { { NULL } }; struct obd_device *obd = lod2obd(lod); struct obd_type *type; struct kobject *lov; diff --git a/lustre/mdd/mdd_lproc.c b/lustre/mdd/mdd_lproc.c index 392719e..56a3b68 100644 --- a/lustre/mdd/mdd_lproc.c +++ b/lustre/mdd/mdd_lproc.c @@ -644,7 +644,7 @@ static ssize_t append_pool_store(struct kobject *kobj, struct attribute *attr, } LUSTRE_RW_ATTR(append_pool); -static struct lprocfs_vars lprocfs_mdd_obd_vars[] = { +static struct ldebugfs_vars ldebugfs_mdd_obd_vars[] = { { .name = "changelog_mask", .fops = &mdd_changelog_mask_fops }, { .name = "changelog_users", @@ -716,10 +716,10 @@ int mdd_procfs_init(struct mdd_device *mdd, const char *name) return rc; /* Find the type procroot and add the proc entry for this device */ - obd->obd_vars = lprocfs_mdd_obd_vars; + obd->obd_debugfs_vars = ldebugfs_mdd_obd_vars; obd->obd_debugfs_entry = debugfs_create_dir(name, type->typ_debugfs_entry); - ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_vars, mdd); + ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_debugfs_vars, mdd); RETURN(rc); } diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c index d19a592..ec4efe8 100644 --- a/lustre/mdt/mdt_coordinator.c +++ b/lustre/mdt/mdt_coordinator.c @@ -47,8 +47,6 @@ #include #include "mdt_internal.h" -static struct lprocfs_vars lprocfs_mdt_hsm_vars[]; - /** * get obj and HSM attributes on a fid * \param mti [IN] context @@ -2504,7 +2502,7 @@ static ssize_t remove_count_show(struct kobject *kobj, struct attribute *attr, } LUSTRE_RO_ATTR(remove_count); -static struct lprocfs_vars lprocfs_mdt_hsm_vars[] = { +static struct ldebugfs_vars ldebugfs_mdt_hsm_vars[] = { { .name = "agents", .fops = &mdt_hsm_agent_fops }, { .name = "actions", @@ -2576,7 +2574,7 @@ int hsm_cdt_tunables_init(struct mdt_device *mdt) /* init debugfs entries, failure is not critical */ cdt->cdt_debugfs_dir = debugfs_create_dir("hsm", obd->obd_debugfs_entry); - ldebugfs_add_vars(cdt->cdt_debugfs_dir, lprocfs_mdt_hsm_vars, mdt); + ldebugfs_add_vars(cdt->cdt_debugfs_dir, ldebugfs_mdt_hsm_vars, mdt); return 0; } diff --git a/lustre/mgc/lproc_mgc.c b/lustre/mgc/lproc_mgc.c index ec4ba5e..f277d3e 100644 --- a/lustre/mgc/lproc_mgc.c +++ b/lustre/mgc/lproc_mgc.c @@ -54,7 +54,7 @@ static int mgc_ir_state_seq_show(struct seq_file *m, void *v) LDEBUGFS_SEQ_FOPS_RO(mgc_ir_state); -struct lprocfs_vars lprocfs_mgc_obd_vars[] = { +struct ldebugfs_vars ldebugfs_mgc_obd_vars[] = { { .name = "connect_flags", .fops = &mgc_connect_flags_fops }, { .name = "mgs_server_uuid", @@ -86,7 +86,7 @@ int mgc_tunables_init(struct obd_device *obd) int rc; obd->obd_ktype.default_attrs = mgc_attrs; - obd->obd_vars = lprocfs_mgc_obd_vars; + obd->obd_debugfs_vars = ldebugfs_mgc_obd_vars; rc = lprocfs_obd_setup(obd, true); if (rc) return rc; diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index e14f216..756a3fd 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -1256,7 +1256,7 @@ int dt_tunables_fini(struct dt_device *dt) EXPORT_SYMBOL(dt_tunables_fini); int dt_tunables_init(struct dt_device *dt, struct obd_type *type, - const char *name, struct lprocfs_vars *list) + const char *name, struct ldebugfs_vars *list) { int rc; diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 2223c14..5771e95 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -223,7 +223,7 @@ EXPORT_SYMBOL(class_add_symlinks); int class_register_type(const struct obd_ops *dt_ops, const struct md_ops *md_ops, - bool enable_proc, struct lprocfs_vars *vars, + bool enable_proc, struct ldebugfs_vars *vars, const char *name, struct lu_device_type *ldt) { struct obd_type *type; diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 3f042962..22f60c4 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -112,9 +112,9 @@ struct proc_dir_entry *lprocfs_add_symlink(const char *name, } EXPORT_SYMBOL(lprocfs_add_symlink); -static const struct file_operations lprocfs_generic_fops = { }; +static const struct file_operations ldebugfs_empty_ops = { }; -void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *list, +void ldebugfs_add_vars(struct dentry *parent, struct ldebugfs_vars *list, void *data) { if (IS_ERR_OR_NULL(parent) || IS_ERR_OR_NULL(list)) @@ -133,12 +133,14 @@ void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *list, } debugfs_create_file(list->name, mode, parent, list->data ? : data, - list->fops ? : &lprocfs_generic_fops); + list->fops ? : &ldebugfs_empty_ops); list++; } } EXPORT_SYMBOL_GPL(ldebugfs_add_vars); +static const struct file_operations lprocfs_empty_ops = { }; + /** * Add /proc entries. * @@ -170,7 +172,7 @@ lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *list, mode |= 0200; } proc = proc_create_data(list->name, mode, root, - list->fops ?: &lprocfs_generic_fops, + list->fops ?: &lprocfs_empty_ops, list->data ?: data); if (!proc) return -ENOMEM; @@ -1045,7 +1047,7 @@ static void obd_sysfs_release(struct kobject *kobj) int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only) { - struct lprocfs_vars *debugfs_vars = NULL; + struct ldebugfs_vars *debugfs_vars = NULL; int rc; if (!obd || obd->obd_magic != OBD_DEVICE_MAGIC) @@ -1077,7 +1079,7 @@ int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only) } if (!obd->obd_type->typ_procroot) - debugfs_vars = obd->obd_vars; + debugfs_vars = obd->obd_debugfs_vars; obd->obd_debugfs_entry = debugfs_create_dir( obd->obd_name, obd->obd_type->typ_debugfs_entry); ldebugfs_add_vars(obd->obd_debugfs_entry, debugfs_vars, obd); @@ -1398,7 +1400,17 @@ static int lprocfs_stats_seq_open(struct inode *inode, struct file *file) return 0; } -const struct file_operations lprocfs_stats_seq_fops = { +const struct file_operations ldebugfs_stats_seq_fops = { + .owner = THIS_MODULE, + .open = lprocfs_stats_seq_open, + .read = seq_read, + .write = lprocfs_stats_seq_write, + .llseek = seq_lseek, + .release = lprocfs_seq_release, +}; +EXPORT_SYMBOL(ldebugfs_stats_seq_fops); + +static const struct file_operations lprocfs_stats_seq_fops = { .owner = THIS_MODULE, .open = lprocfs_stats_seq_open, .read = seq_read, @@ -1406,7 +1418,6 @@ const struct file_operations lprocfs_stats_seq_fops = { .llseek = seq_lseek, .release = lprocfs_seq_release, }; -EXPORT_SYMBOL(lprocfs_stats_seq_fops); int lprocfs_register_stats(struct proc_dir_entry *root, const char *name, struct lprocfs_stats *stats) diff --git a/lustre/osd-ldiskfs/osd_lproc.c b/lustre/osd-ldiskfs/osd_lproc.c index 082816b..36e27c6 100644 --- a/lustre/osd-ldiskfs/osd_lproc.c +++ b/lustre/osd-ldiskfs/osd_lproc.c @@ -792,7 +792,7 @@ ssize_t index_backup_store(struct kobject *kobj, struct attribute *attr, } LUSTRE_RW_ATTR(index_backup); -struct lprocfs_vars lprocfs_osd_obd_vars[] = { +struct ldebugfs_vars ldebugfs_osd_obd_vars[] = { { .name = "oi_scrub", .fops = &ldiskfs_osd_oi_scrub_fops }, { .name = "readcache_max_filesize", @@ -841,7 +841,7 @@ int osd_procfs_init(struct osd_device *osd, const char *name) osd->od_dt_dev.dd_ktype.default_attrs = ldiskfs_attrs; rc = dt_tunables_init(&osd->od_dt_dev, type, name, - lprocfs_osd_obd_vars); + ldebugfs_osd_obd_vars); if (rc) { CERROR("%s: cannot setup sysfs / debugfs entry: %d\n", name, rc); diff --git a/lustre/osd-zfs/osd_lproc.c b/lustre/osd-zfs/osd_lproc.c index 7e742fd..c91ccf4 100644 --- a/lustre/osd-zfs/osd_lproc.c +++ b/lustre/osd-zfs/osd_lproc.c @@ -422,7 +422,7 @@ static struct attribute *zfs_attrs[] = { NULL, }; -struct lprocfs_vars lprocfs_osd_obd_vars[] = { +struct ldebugfs_vars ldebugfs_osd_obd_vars[] = { { .name = "oi_scrub", .fops = &zfs_osd_oi_scrub_fops }, { .name = "readcache_max_filesize", @@ -450,7 +450,7 @@ int osd_procfs_init(struct osd_device *osd, const char *name) osd->od_dt_dev.dd_ktype.default_attrs = zfs_attrs; rc = dt_tunables_init(&osd->od_dt_dev, type, name, - lprocfs_osd_obd_vars); + ldebugfs_osd_obd_vars); if (rc) { CERROR("%s: cannot setup sysfs / debugfs entry: %d\n", name, rc); diff --git a/lustre/osp/lproc_osp.c b/lustre/osp/lproc_osp.c index d5d7820..08ec720 100644 --- a/lustre/osp/lproc_osp.c +++ b/lustre/osp/lproc_osp.c @@ -797,7 +797,7 @@ LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, connect_flags); LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, server_uuid); LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, timeouts); -LPROC_SEQ_FOPS_RW_TYPE(osp, import); +LDEBUGFS_SEQ_FOPS_RW_TYPE(osp, import); LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, state); /** @@ -955,7 +955,7 @@ static ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr, } LUSTRE_WO_ATTR(force_sync); -static struct lprocfs_vars lprocfs_osp_obd_vars[] = { +static struct ldebugfs_vars ldebugfs_osp_obd_vars[] = { { .name = "connect_flags", .fops = &osp_connect_flags_fops }, { .name = "ost_server_uuid", @@ -973,7 +973,7 @@ static struct lprocfs_vars lprocfs_osp_obd_vars[] = { { NULL } }; -static struct lprocfs_vars lprocfs_osp_md_vars[] = { +static struct ldebugfs_vars ldebugfs_osp_md_vars[] = { { .name = "connect_flags", .fops = &osp_connect_flags_fops }, { .name = "mdt_server_uuid", @@ -1062,10 +1062,10 @@ void osp_tunables_init(struct osp_device *osp) if (osp->opd_connect_mdt) { osp->opd_dt_dev.dd_ktype.default_attrs = osp_md_attrs; - obd->obd_vars = lprocfs_osp_md_vars; + obd->obd_debugfs_vars = ldebugfs_osp_md_vars; } else { osp->opd_dt_dev.dd_ktype.default_attrs = osp_obd_attrs; - obd->obd_vars = lprocfs_osp_obd_vars; + obd->obd_debugfs_vars = ldebugfs_osp_obd_vars; } rc = dt_tunables_init(&osp->opd_dt_dev, obd->obd_type, obd->obd_name, @@ -1081,7 +1081,7 @@ void osp_tunables_init(struct osp_device *osp) */ obd->obd_debugfs_entry = debugfs_create_dir( obd->obd_name, obd->obd_type->typ_debugfs_entry); - ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_vars, obd); + ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_debugfs_vars, obd); sptlrpc_lprocfs_cliobd_attach(obd); ptlrpc_lprocfs_register_obd(obd); diff --git a/lustre/ptlrpc/gss/lproc_gss.c b/lustre/ptlrpc/gss/lproc_gss.c index 29e5c49..01e9757 100644 --- a/lustre/ptlrpc/gss/lproc_gss.c +++ b/lustre/ptlrpc/gss/lproc_gss.c @@ -155,7 +155,7 @@ ssize_t sptlrpc_krb5_allow_old_client_csum_seq_write(struct file *file, } LPROC_SEQ_FOPS(sptlrpc_krb5_allow_old_client_csum); -static struct lprocfs_vars gss_debugfs_vars[] = { +static struct ldebugfs_vars gss_debugfs_vars[] = { { .name = "replays", .fops = &gss_proc_oos_fops }, { .name = "init_channel", @@ -203,7 +203,7 @@ gss_lk_proc_dl_seq_write(struct file *file, const char __user *buffer, } LDEBUGFS_SEQ_FOPS(gss_lk_proc_dl); -static struct lprocfs_vars gss_lk_debugfs_vars[] = { +static struct ldebugfs_vars gss_lk_debugfs_vars[] = { { .name = "debug_level", .fops = &gss_lk_proc_dl_fops }, { NULL } diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index ee5e8c3..03bb88d 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -254,7 +254,7 @@ ptlrpc_ldebugfs_register(struct dentry *root, char *dir, char *name, } debugfs_create_file(name, 0644, svc_debugfs_entry, svc_stats, - &lprocfs_stats_seq_fops); + &ldebugfs_stats_seq_fops); if (dir) *debugfs_root_ret = svc_debugfs_entry; @@ -1190,7 +1190,7 @@ int ptlrpc_sysfs_register_service(struct kset *parent, void ptlrpc_ldebugfs_register_service(struct dentry *entry, struct ptlrpc_service *svc) { - struct lprocfs_vars lproc_vars[] = { + struct ldebugfs_vars ldebugfs_vars[] = { { .name = "req_buffer_history_len", .fops = &ptlrpc_lprocfs_req_history_len_fops, .data = svc }, @@ -1221,7 +1221,7 @@ void ptlrpc_ldebugfs_register_service(struct dentry *entry, if (!svc->srv_debugfs_entry) return; - ldebugfs_add_vars(svc->srv_debugfs_entry, lproc_vars, NULL); + ldebugfs_add_vars(svc->srv_debugfs_entry, ldebugfs_vars, NULL); debugfs_create_file("req_history", 0400, svc->srv_debugfs_entry, svc, &req_history_fops); @@ -1341,8 +1341,8 @@ EXPORT_SYMBOL(ping_store); * "echo connection=192.168.0.1@tcp0::instance > .../import". */ ssize_t -lprocfs_import_seq_write(struct file *file, const char __user *buffer, - size_t count, loff_t *off) +ldebugfs_import_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { struct seq_file *m = file->private_data; struct obd_device *obd = m->private; @@ -1407,7 +1407,7 @@ out: OBD_FREE(kbuf, count + 1); return rc ?: count; } -EXPORT_SYMBOL(lprocfs_import_seq_write); +EXPORT_SYMBOL(ldebugfs_import_seq_write); int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *n) { diff --git a/lustre/ptlrpc/nrs_crr.c b/lustre/ptlrpc/nrs_crr.c index da6e417c..41d0cb6 100644 --- a/lustre/ptlrpc/nrs_crr.c +++ b/lustre/ptlrpc/nrs_crr.c @@ -786,7 +786,7 @@ LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_crrn_quantum); */ static int nrs_crrn_lprocfs_init(struct ptlrpc_service *svc) { - struct lprocfs_vars nrs_crrn_lprocfs_vars[] = { + struct ldebugfs_vars nrs_crrn_lprocfs_vars[] = { { .name = "nrs_crrn_quantum", .fops = &ptlrpc_lprocfs_nrs_crrn_quantum_fops, .data = svc }, diff --git a/lustre/ptlrpc/nrs_delay.c b/lustre/ptlrpc/nrs_delay.c index 936782c..7222c09 100644 --- a/lustre/ptlrpc/nrs_delay.c +++ b/lustre/ptlrpc/nrs_delay.c @@ -779,7 +779,7 @@ LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_delay_pct); static int nrs_delay_lprocfs_init(struct ptlrpc_service *svc) { - struct lprocfs_vars nrs_delay_lprocfs_vars[] = { + struct ldebugfs_vars nrs_delay_lprocfs_vars[] = { { .name = "nrs_delay_min", .fops = &ptlrpc_lprocfs_nrs_delay_min_fops, .data = svc }, diff --git a/lustre/ptlrpc/nrs_orr.c b/lustre/ptlrpc/nrs_orr.c index af10670..9324dbd 100644 --- a/lustre/ptlrpc/nrs_orr.c +++ b/lustre/ptlrpc/nrs_orr.c @@ -1866,7 +1866,7 @@ static int nrs_orr_lprocfs_init(struct ptlrpc_service *svc) { int i; - struct lprocfs_vars nrs_orr_lprocfs_vars[] = { + struct ldebugfs_vars nrs_orr_lprocfs_vars[] = { { .name = "nrs_orr_quantum", .fops = &ptlrpc_lprocfs_nrs_orr_quantum_fops }, { .name = "nrs_orr_offset_type", @@ -1919,7 +1919,7 @@ static int nrs_trr_lprocfs_init(struct ptlrpc_service *svc) { int i; - struct lprocfs_vars nrs_trr_lprocfs_vars[] = { + struct ldebugfs_vars nrs_trr_lprocfs_vars[] = { { .name = "nrs_trr_quantum", .fops = &ptlrpc_lprocfs_nrs_orr_quantum_fops }, { .name = "nrs_trr_offset_type", diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index 76c8e4cd..9521d69 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -3659,7 +3659,7 @@ LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule); */ static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc) { - struct lprocfs_vars nrs_tbf_lprocfs_vars[] = { + struct ldebugfs_vars nrs_tbf_lprocfs_vars[] = { { .name = "nrs_tbf_rule", .fops = &ptlrpc_lprocfs_nrs_tbf_rule_fops, .data = svc }, diff --git a/lustre/ptlrpc/sec_lproc.c b/lustre/ptlrpc/sec_lproc.c index 41ef7e0..c09a83e 100644 --- a/lustre/ptlrpc/sec_lproc.c +++ b/lustre/ptlrpc/sec_lproc.c @@ -107,7 +107,7 @@ out: return 0; } -LPROC_SEQ_FOPS_RO(sptlrpc_info_lprocfs); +LDEBUGFS_SEQ_FOPS_RO(sptlrpc_info_lprocfs); static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v) { @@ -134,7 +134,7 @@ out: return 0; } -LPROC_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs); +LDEBUGFS_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs); #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0) static ssize_t sepol_seq_write_old(struct obd_device *obd, @@ -218,8 +218,8 @@ out: #endif static ssize_t -lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer, - size_t count, void *data) +ldebugfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer, + size_t count, void *data) { struct seq_file *seq = file->private_data; struct obd_device *obd = seq->private; @@ -310,7 +310,7 @@ out: return rc ? rc : count; } -LPROC_SEQ_FOPS_WR_ONLY(srpc, sptlrpc_sepol); +LDEBUGFS_FOPS_WR_ONLY(srpc, sptlrpc_sepol); int sptlrpc_lprocfs_cliobd_attach(struct obd_device *obd) { @@ -339,7 +339,7 @@ EXPORT_SYMBOL(sptlrpc_lprocfs_cliobd_attach); LDEBUGFS_SEQ_FOPS_RO(sptlrpc_proc_enc_pool); -static struct lprocfs_vars sptlrpc_lprocfs_vars[] = { +static struct ldebugfs_vars sptlrpc_lprocfs_vars[] = { { .name = "encrypt_page_pools", .fops = &sptlrpc_proc_enc_pool_fops }, { NULL } -- 1.8.3.1