From cd5d04b3722e2edca02671ab5b8729070de20275 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Tue, 10 Dec 2019 11:03:08 +1100 Subject: [PATCH] LU-9855 lustre: rename obd_device variables to obd Most variables of type 'struct obd_device *' are named 'obd' - 655 of them. 81 are named 'dev' 29 are named 'obddev' The remainder (< 100) have various names specific to the used (e.g disk_obd, src, tgt etc), none used more than 11 times (mgc). As 'obd', 'dev', and 'obddev' are all simple generic names, it would be nice to be consistent and only use one of these. This patch changes all 'dev' and 'obddev' variables to 'obd'. Also change some "sprintf" to "scnprintf .. PAGE_SIZE" to avoid warnings. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I640c4f121d7db6aec1fef848a84463d46f68f262 Reviewed-on: https://review.whamcloud.com/36969 Tested-by: Maloo Tested-by: jenkins Reviewed-by: James Simmons Reviewed-by: Andreas Dilger --- lustre/include/lprocfs_status.h | 30 +++++------ lustre/include/lustre_net.h | 4 +- lustre/include/lustre_osc.h | 4 +- lustre/include/lustre_sec.h | 2 +- lustre/include/obd.h | 10 ++-- lustre/include/obd_class.h | 16 +++--- lustre/ldlm/ldlm_lib.c | 42 +++++++-------- lustre/lmv/lmv_obd.c | 18 +++---- lustre/lmv/lproc_lmv.c | 54 +++++++++---------- lustre/lod/lproc_lod.c | 16 +++--- lustre/lov/lov_obd.c | 16 +++--- lustre/lov/lproc_lov.c | 82 ++++++++++++++-------------- lustre/mdc/lproc_mdc.c | 72 ++++++++++++------------- lustre/mdc/mdc_locks.c | 42 +++++++-------- lustre/obdclass/genops.c | 20 +++---- lustre/obdclass/lprocfs_status.c | 24 ++++----- lustre/obdecho/echo.c | 8 +-- lustre/obdecho/echo_client.c | 20 +++---- lustre/osc/lproc_osc.c | 112 +++++++++++++++++++-------------------- lustre/ptlrpc/lproc_ptlrpc.c | 8 +-- lustre/ptlrpc/sec_lproc.c | 80 ++++++++++++++-------------- 21 files changed, 341 insertions(+), 339 deletions(-) diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index 93e7200..23d3511 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -479,18 +479,18 @@ lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags); extern void lprocfs_clear_stats(struct lprocfs_stats *stats); extern void lprocfs_free_stats(struct lprocfs_stats **stats); extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats); -extern int lprocfs_alloc_obd_stats(struct obd_device *obddev, +extern int lprocfs_alloc_obd_stats(struct obd_device *obd, unsigned int num_stats); -extern int lprocfs_alloc_md_stats(struct obd_device *obddev, - unsigned int num_private_stats); +extern int lprocfs_alloc_md_stats(struct obd_device *obd, + unsigned int num_private_stats); extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index, - unsigned conf, const char *name, - const char *units); -extern void lprocfs_free_obd_stats(struct obd_device *obddev); -extern void lprocfs_free_md_stats(struct obd_device *obddev); + unsigned conf, const char *name, + const char *units); +extern void lprocfs_free_obd_stats(struct obd_device *obd); +extern void lprocfs_free_md_stats(struct obd_device *obd); struct obd_export; struct nid_stat; -extern int lprocfs_add_clear_entry(struct obd_device * obd, +extern int lprocfs_add_clear_entry(struct obd_device *obd, struct proc_dir_entry *entry); #ifdef HAVE_SERVER_SUPPORT extern int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *peer_nid); @@ -550,7 +550,7 @@ extern int lprocfs_seq_create(struct proc_dir_entry *parent, const char *name, mode_t mode, const struct file_operations *seq_fops, void *data); -extern int lprocfs_obd_seq_create(struct obd_device *dev, const char *name, +extern int lprocfs_obd_seq_create(struct obd_device *obd, const char *name, mode_t mode, const struct file_operations *seq_fops, void *data); @@ -893,15 +893,15 @@ static inline int lprocfs_register_stats(struct proc_dir_entry *root, { return 0; } static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats) { return; } -static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev, +static inline int lprocfs_alloc_obd_stats(struct obd_device *obd, unsigned int num_stats) { return 0; } -static inline int lprocfs_alloc_md_stats(struct obd_device *obddev, +static inline int lprocfs_alloc_md_stats(struct obd_device *obd, unsigned int num_private_stats) { return 0; } -static inline void lprocfs_free_obd_stats(struct obd_device *obddev) +static inline void lprocfs_free_obd_stats(struct obd_device *obd) { return; } -static inline void lprocfs_free_md_stats(struct obd_device *obddev) +static inline void lprocfs_free_md_stats(struct obd_device *obd) { return; } struct obd_export; @@ -943,9 +943,9 @@ static inline void lprocfs_remove(struct proc_dir_entry **root) static inline void lprocfs_remove_proc_entry(const char *name, struct proc_dir_entry *parent) { return; } -static inline int lprocfs_obd_setup(struct obd_device *dev, bool uuid_only) +static inline int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only) { return 0; } -static inline int lprocfs_obd_cleanup(struct obd_device *dev) +static inline int lprocfs_obd_cleanup(struct obd_device *obd) { return 0; } static inline int lprocfs_uuid_seq_show(struct seq_file *m, void *data) { return 0; } diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 678e482..1632b3b 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -2563,8 +2563,8 @@ ptlrpc_req2svc(struct ptlrpc_request *req) * Target client logic * @{ */ -int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg); -int client_obd_cleanup(struct obd_device *obddev); +int client_obd_setup(struct obd_device *obd, struct lustre_cfg *lcfg); +int client_obd_cleanup(struct obd_device *obd); int client_connect_import(const struct lu_env *env, struct obd_export **exp, struct obd_device *obd, struct obd_uuid *cluuid, struct obd_connect_data *, diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index f9ab603..376830c 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -765,9 +765,9 @@ static inline struct cl_object *osc2cl(const struct osc_object *obj) return (struct cl_object *)&obj->oo_cl; } -static inline struct osc_device *obd2osc_dev(const struct obd_device *d) +static inline struct osc_device *obd2osc_dev(const struct obd_device *obd) { - return container_of0(d->obd_lu_dev, struct osc_device, + return container_of0(obd->obd_lu_dev, struct osc_device, od_cl.cd_lu_dev); } diff --git a/lustre/include/lustre_sec.h b/lustre/include/lustre_sec.h index ee2204f..e67e994 100644 --- a/lustre/include/lustre_sec.h +++ b/lustre/include/lustre_sec.h @@ -1129,7 +1129,7 @@ void sptlrpc_gc_add_ctx(struct ptlrpc_cli_ctx *ctx); /* misc */ const char * sec2target_str(struct ptlrpc_sec *sec); -int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev); +int sptlrpc_lprocfs_cliobd_attach(struct obd_device *obd); /* * server side diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 8461df7..6a5f2dc 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -949,11 +949,11 @@ struct obd_ops { __u32 keylen, void *key, __u32 vallen, void *val, struct ptlrpc_request_set *set); - int (*o_setup) (struct obd_device *dev, struct lustre_cfg *cfg); - int (*o_precleanup)(struct obd_device *dev); - int (*o_cleanup)(struct obd_device *dev); - int (*o_process_config)(struct obd_device *dev, size_t len, void *data); - int (*o_postrecov)(struct obd_device *dev); + int (*o_setup) (struct obd_device *obd, struct lustre_cfg *cfg); + int (*o_precleanup)(struct obd_device *obd); + int (*o_cleanup)(struct obd_device *obd); + int (*o_process_config)(struct obd_device *obd, size_t len, void *data); + int (*o_postrecov)(struct obd_device *obd); int (*o_add_conn)(struct obd_import *imp, struct obd_uuid *uuid, int priority); int (*o_del_conn)(struct obd_import *imp, struct obd_uuid *uuid); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 320914e..a077f8a 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -86,12 +86,12 @@ struct obd_device *class_name2obd(const char *name); int class_uuid2dev(struct obd_uuid *uuid); struct obd_device *class_uuid2obd(struct obd_uuid *uuid); void class_obd_list(void); -struct obd_device * class_find_client_obd(struct obd_uuid *tgt_uuid, - const char *type_name, - struct obd_uuid *grp_uuid); -struct obd_device * class_devices_in_group(struct obd_uuid *grp_uuid, - int *next); -struct obd_device * class_num2obd(int num); +struct obd_device *class_find_client_obd(struct obd_uuid *tgt_uuid, + const char *type_name, + struct obd_uuid *grp_uuid); +struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, + int *next); +struct obd_device *class_num2obd(int num); int get_devices_count(void); int class_notify_sptlrpc_conf(const char *fsname, int namelen); @@ -348,7 +348,7 @@ extern void (*class_export_dump_hook)(struct obd_export *); /* genops.c */ struct obd_export *class_export_get(struct obd_export *exp); void class_export_put(struct obd_export *exp); -struct obd_export *class_new_export(struct obd_device *obddev, +struct obd_export *class_new_export(struct obd_device *obd, struct obd_uuid *cluuid); struct obd_export *class_new_export_self(struct obd_device *obd, struct obd_uuid *uuid); @@ -369,7 +369,7 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd, int class_disconnect(struct obd_export *exp); void class_fail_export(struct obd_export *exp); int class_connected_export(struct obd_export *exp); -void class_disconnect_exports(struct obd_device *obddev); +void class_disconnect_exports(struct obd_device *obd); int class_manual_cleanup(struct obd_device *obd); void class_disconnect_stale_exports(struct obd_device *, int (*test_export)(struct obd_export *)); diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 87a04f7..79c6e99 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -271,13 +271,13 @@ static int osc_on_mdt(char *obdname) * 3 - inactive-on-startup * 4 - restrictive net */ -int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) +int client_obd_setup(struct obd_device *obd, struct lustre_cfg *lcfg) { - struct client_obd *cli = &obddev->u.cli; + struct client_obd *cli = &obd->u.cli; struct obd_import *imp; struct obd_uuid server_uuid; int rq_portal, rp_portal, connect_op; - const char *name = obddev->obd_type->typ_name; + const char *name = obd->obd_type->typ_name; enum ldlm_ns_type ns_type = LDLM_NS_TYPE_UNKNOWN; char *cli_name = lustre_cfg_buf(lcfg, 0); struct ptlrpc_connection fake_conn = { .c_self = 0, @@ -451,7 +451,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) } else if (cfs_totalram_pages() >> (20 - PAGE_SHIFT) <= 512 /* MB */) { cli->cl_max_rpcs_in_flight = 4; } else { - if (osc_on_mdt(obddev->obd_name)) + if (osc_on_mdt(obd->obd_name)) cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_MAX; else cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_DEFAULT; @@ -482,12 +482,12 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) } ptlrpc_init_client(rq_portal, rp_portal, name, - &obddev->obd_ldlm_client); + &obd->obd_ldlm_client); - imp = class_new_import(obddev); + imp = class_new_import(obd); if (imp == NULL) GOTO(err_ldlm, rc = -ENOENT); - imp->imp_client = &obddev->obd_ldlm_client; + imp->imp_client = &obd->obd_ldlm_client; imp->imp_connect_op = connect_op; memcpy(cli->cl_target_uuid.uuid, lustre_cfg_buf(lcfg, 1), LUSTRE_CFG_BUFLEN(lcfg, 1)); @@ -499,7 +499,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) if (refnet == LNET_NIDNET(LNET_NID_ANY)) { rc = -EINVAL; CERROR("%s: bad mount option 'network=%s': rc = %d\n", - obddev->obd_name, lustre_cfg_string(lcfg, 4), + obd->obd_name, lustre_cfg_string(lcfg, 4), rc); GOTO(err_import, rc); } @@ -521,7 +521,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) if (LUSTRE_CFG_BUFLEN(lcfg, 3) > 0) { if (!strcmp(lustre_cfg_string(lcfg, 3), "inactive")) { CDEBUG(D_HA, "marking %s %s->%s as inactive\n", - name, obddev->obd_name, + name, obd->obd_name, cli->cl_target_uuid.uuid); spin_lock(&imp->imp_lock); imp->imp_deactive = 1; @@ -529,13 +529,13 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) } } - obddev->obd_namespace = ldlm_namespace_new(obddev, obddev->obd_name, - LDLM_NAMESPACE_CLIENT, - LDLM_NAMESPACE_GREEDY, - ns_type); - if (obddev->obd_namespace == NULL) { + obd->obd_namespace = ldlm_namespace_new(obd, obd->obd_name, + LDLM_NAMESPACE_CLIENT, + LDLM_NAMESPACE_GREEDY, + ns_type); + if (obd->obd_namespace == NULL) { CERROR("Unable to create client namespace - %s\n", - obddev->obd_name); + obd->obd_name); GOTO(err_import, rc = -ENOMEM); } @@ -555,17 +555,17 @@ err: } EXPORT_SYMBOL(client_obd_setup); -int client_obd_cleanup(struct obd_device *obddev) +int client_obd_cleanup(struct obd_device *obd) { - struct client_obd *cli = &obddev->u.cli; + struct client_obd *cli = &obd->u.cli; ENTRY; - ldlm_namespace_free_post(obddev->obd_namespace); - obddev->obd_namespace = NULL; + ldlm_namespace_free_post(obd->obd_namespace); + obd->obd_namespace = NULL; - obd_cleanup_client_import(obddev); - LASSERT(obddev->u.cli.cl_import == NULL); + obd_cleanup_client_import(obd); + LASSERT(obd->u.cli.cl_import == NULL); ldlm_put_ref(); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index be17eb0..1484f67 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -557,8 +557,8 @@ static int lmv_disconnect(struct obd_export *exp) static int lmv_fid2path(struct obd_export *exp, int len, void *karg, void __user *uarg) { - struct obd_device *obddev = class_exp2obd(exp); - struct lmv_obd *lmv = &obddev->u.lmv; + struct obd_device *obd = class_exp2obd(exp); + struct lmv_obd *lmv = &obd->u.lmv; struct getinfo_fid2path *gf; struct lmv_tgt_desc *tgt; struct getinfo_fid2path *remote_gf = NULL; @@ -812,8 +812,8 @@ err_fput: static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp, int len, void *karg, void __user *uarg) { - struct obd_device *obddev = class_exp2obd(exp); - struct lmv_obd *lmv = &obddev->u.lmv; + struct obd_device *obd = class_exp2obd(exp); + struct lmv_obd *lmv = &obd->u.lmv; struct lu_tgt_desc *tgt = NULL; int set = 0; __u32 count = lmv->lmv_mdt_count; @@ -1020,9 +1020,9 @@ hsm_req_err: case LL_IOC_HSM_CT_START: { struct lustre_kernelcomm *lk = karg; if (lk->lk_flags & LK_FLG_STOP) - rc = lmv_hsm_ct_unregister(obddev, cmd, len, lk, uarg); + rc = lmv_hsm_ct_unregister(obd, cmd, len, lk, uarg); else - rc = lmv_hsm_ct_register(obddev, cmd, len, lk, uarg); + rc = lmv_hsm_ct_register(obd, cmd, len, lk, uarg); break; } default: @@ -1033,7 +1033,7 @@ hsm_req_err: /* ll_umount_begin() sets force flag but for lmv, not * mdc. Let's pass it through */ mdc_obd = class_exp2obd(tgt->ltd_exp); - mdc_obd->obd_force = obddev->obd_force; + mdc_obd->obd_force = obd->obd_force; err = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg); if (err) { if (tgt->ltd_active) { @@ -2939,9 +2939,9 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp, static int lmv_rmfid(struct obd_export *exp, struct fid_array *fa, int *__rcs, struct ptlrpc_request_set *_set) { - struct obd_device *obddev = class_exp2obd(exp); + struct obd_device *obd = class_exp2obd(exp); struct ptlrpc_request_set *set = _set; - struct lmv_obd *lmv = &obddev->u.lmv; + struct lmv_obd *lmv = &obd->u.lmv; int tgt_count = lmv->lmv_mdt_count; struct lu_tgt_desc *tgt; struct fid_array *fat, **fas = NULL; diff --git a/lustre/lmv/lproc_lmv.c b/lustre/lmv/lproc_lmv.c index 97faa02..6e0e7cc 100644 --- a/lustre/lmv/lproc_lmv.c +++ b/lustre/lmv/lproc_lmv.c @@ -42,32 +42,32 @@ static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - return sprintf(buf, "%u\n", dev->u.lmv.lmv_mdt_count); + return scnprintf(buf, PAGE_SIZE, "%u\n", obd->u.lmv.lmv_mdt_count); } LUSTRE_RO_ATTR(numobd); static ssize_t activeobd_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - return sprintf(buf, "%u\n", - dev->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_active_tgt_count); + return scnprintf(buf, PAGE_SIZE, "%u\n", + obd->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_active_tgt_count); } LUSTRE_RO_ATTR(activeobd); static ssize_t desc_uuid_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - return sprintf(buf, "%s\n", - dev->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_uuid.uuid); + return scnprintf(buf, PAGE_SIZE, "%s\n", + obd->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_uuid.uuid); } LUSTRE_RO_ATTR(desc_uuid); @@ -75,11 +75,11 @@ static ssize_t qos_maxage_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - return sprintf(buf, "%u\n", - dev->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_qos_maxage); + return scnprintf(buf, PAGE_SIZE, "%u\n", + obd->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_qos_maxage); } static ssize_t qos_maxage_store(struct kobject *kobj, @@ -87,7 +87,7 @@ static ssize_t qos_maxage_store(struct kobject *kobj, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); unsigned int val; int rc; @@ -96,7 +96,7 @@ static ssize_t qos_maxage_store(struct kobject *kobj, if (rc) return rc; - dev->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_qos_maxage = val; + obd->u.lmv.lmv_mdt_descs.ltd_lmv_desc.ld_qos_maxage = val; return count; } @@ -106,11 +106,11 @@ static ssize_t qos_prio_free_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - return sprintf(buf, "%u%%\n", - (dev->u.lmv.lmv_qos.lq_prio_free * 100 + 255) >> 8); + return scnprintf(buf, PAGE_SIZE, "%u%%\n", + (obd->u.lmv.lmv_qos.lq_prio_free * 100 + 255) >> 8); } static ssize_t qos_prio_free_store(struct kobject *kobj, @@ -118,9 +118,9 @@ static ssize_t qos_prio_free_store(struct kobject *kobj, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lmv_obd *lmv = &dev->u.lmv; + struct lmv_obd *lmv = &obd->u.lmv; unsigned int val; int rc; @@ -143,11 +143,11 @@ static ssize_t qos_threshold_rr_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - return sprintf(buf, "%u%%\n", - (dev->u.lmv.lmv_qos.lq_threshold_rr * 100 + 255) >> 8); + return scnprintf(buf, PAGE_SIZE, "%u%%\n", + (obd->u.lmv.lmv_qos.lq_threshold_rr * 100 + 255) >> 8); } static ssize_t qos_threshold_rr_store(struct kobject *kobj, @@ -155,9 +155,9 @@ static ssize_t qos_threshold_rr_store(struct kobject *kobj, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lmv_obd *lmv = &dev->u.lmv; + struct lmv_obd *lmv = &obd->u.lmv; unsigned int val; int rc; @@ -178,8 +178,8 @@ LUSTRE_RW_ATTR(qos_threshold_rr); #ifdef CONFIG_PROC_FS static void *lmv_tgt_seq_start(struct seq_file *p, loff_t *pos) { - struct obd_device *dev = p->private; - struct lmv_obd *lmv = &dev->u.lmv; + struct obd_device *obd = p->private; + struct lmv_obd *lmv = &obd->u.lmv; struct lu_tgt_desc *tgt; while (*pos < lmv->lmv_mdt_descs.ltd_tgts_size) { @@ -199,8 +199,8 @@ static void lmv_tgt_seq_stop(struct seq_file *p, void *v) static void *lmv_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos) { - struct obd_device *dev = p->private; - struct lmv_obd *lmv = &dev->u.lmv; + struct obd_device *obd = p->private; + struct lmv_obd *lmv = &obd->u.lmv; struct lu_tgt_desc *tgt; ++*pos; diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c index d41c7cf..bcc09b9 100644 --- a/lustre/lod/lproc_lod.c +++ b/lustre/lod/lproc_lod.c @@ -672,12 +672,12 @@ LUSTRE_RW_ATTR(qos_maxage); static void *lod_tgts_seq_start(struct seq_file *p, loff_t *pos, bool is_mdt) { - struct obd_device *dev = p->private; - struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev); + struct obd_device *obd = p->private; + struct lod_device *lod = lu2lod_dev(obd->obd_lu_dev); struct lu_tgt_descs *ltd = is_mdt ? &lod->lod_mdt_descs : &lod->lod_ost_descs; - LASSERT(dev != NULL); + LASSERT(obd != NULL); lod_getref(ltd); /* released in lod_tgts_seq_stop */ if (*pos >= ltd->ltd_tgt_bitmap->size) @@ -703,12 +703,12 @@ static void *lod_osts_seq_start(struct seq_file *p, loff_t *pos) static void lod_tgts_seq_stop(struct seq_file *p, void *v, bool is_mdt) { - struct obd_device *dev = p->private; - struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev); + struct obd_device *obd = p->private; + struct lod_device *lod = lu2lod_dev(obd->obd_lu_dev); struct lu_tgt_descs *ltd = is_mdt ? &lod->lod_mdt_descs : &lod->lod_ost_descs; - LASSERT(dev != NULL); + LASSERT(obd != NULL); lod_putref(lod, ltd); } @@ -725,8 +725,8 @@ static void lod_osts_seq_stop(struct seq_file *p, void *v) static void *lod_tgts_seq_next(struct seq_file *p, void *v, loff_t *pos, bool is_mdt) { - struct obd_device *dev = p->private; - struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev); + struct obd_device *obd = p->private; + struct lod_device *lod = lu2lod_dev(obd->obd_lu_dev); struct lu_tgt_descs *ltd = is_mdt ? &lod->lod_mdt_descs : &lod->lod_ost_descs; diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index a66b697..b1600e4 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -1147,8 +1147,8 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, static int lov_get_info(const struct lu_env *env, struct obd_export *exp, __u32 keylen, void *key, __u32 *vallen, void *val) { - struct obd_device *obddev = class_exp2obd(exp); - struct lov_obd *lov = &obddev->u.lov; + struct obd_device *obd = class_exp2obd(exp); + struct lov_obd *lov = &obd->u.lov; struct lov_desc *ld = &lov->desc; int rc = 0; ENTRY; @@ -1156,7 +1156,7 @@ static int lov_get_info(const struct lu_env *env, struct obd_export *exp, if (vallen == NULL || val == NULL) RETURN(-EFAULT); - lov_tgts_getref(obddev); + lov_tgts_getref(obd); if (KEY_IS(KEY_MAX_EASIZE)) { *((u32 *)val) = exp->exp_connect_data.ocd_max_easize; @@ -1171,7 +1171,7 @@ static int lov_get_info(const struct lu_env *env, struct obd_export *exp, rc = -EINVAL; } - lov_tgts_putref(obddev); + lov_tgts_putref(obd); RETURN(rc); } @@ -1181,8 +1181,8 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, __u32 vallen, void *val, struct ptlrpc_request_set *set) { - struct obd_device *obddev = class_exp2obd(exp); - struct lov_obd *lov = &obddev->u.lov; + struct obd_device *obd = class_exp2obd(exp); + struct lov_obd *lov = &obd->u.lov; struct lov_tgt_desc *tgt; bool do_inactive = false, no_set = false; u32 i; @@ -1198,7 +1198,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, RETURN(-ENOMEM); } - lov_tgts_getref(obddev); + lov_tgts_getref(obd); if (KEY_IS(KEY_CHECKSUM)) do_inactive = true; @@ -1235,7 +1235,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, rc = err; } - lov_tgts_putref(obddev); + lov_tgts_putref(obd); if (no_set) { err = ptlrpc_set_wait(env, set); if (rc == 0) diff --git a/lustre/lov/lproc_lov.c b/lustre/lov/lproc_lov.c index 234eeb3..204e401 100644 --- a/lustre/lov/lproc_lov.c +++ b/lustre/lov/lproc_lov.c @@ -40,11 +40,11 @@ static int lov_stripesize_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = (struct obd_device *)m->private; + struct obd_device *obd = (struct obd_device *)m->private; struct lov_desc *desc; - LASSERT(dev != NULL); - desc = &dev->u.lov.desc; + LASSERT(obd != NULL); + desc = &obd->u.lov.desc; seq_printf(m, "%llu\n", desc->ld_default_stripe_size); return 0; @@ -55,14 +55,14 @@ static ssize_t lov_stripesize_seq_write(struct file *file, size_t count, loff_t *off) { struct seq_file *m = file->private_data; - struct obd_device *dev = m->private; + struct obd_device *obd = m->private; struct lov_desc *desc; char kernbuf[22] = ""; u64 val; int rc; - LASSERT(dev != NULL); - desc = &dev->u.lov.desc; + LASSERT(obd != NULL); + desc = &obd->u.lov.desc; if (count >= sizeof(kernbuf)) return -EINVAL; @@ -85,9 +85,9 @@ LPROC_SEQ_FOPS(lov_stripesize); static ssize_t stripeoffset_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; return sprintf(buf, "%lld\n", desc->ld_default_stripe_offset); } @@ -95,9 +95,9 @@ static ssize_t stripeoffset_show(struct kobject *kobj, struct attribute *attr, static ssize_t stripeoffset_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; long val; int rc; @@ -116,9 +116,9 @@ LUSTRE_RW_ATTR(stripeoffset); static ssize_t stripetype_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; return sprintf(buf, "%u\n", desc->ld_pattern); } @@ -126,9 +126,9 @@ static ssize_t stripetype_show(struct kobject *kobj, struct attribute *attr, static ssize_t stripetype_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; u32 pattern; int rc; @@ -146,9 +146,9 @@ LUSTRE_RW_ATTR(stripetype); static ssize_t stripecount_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; return sprintf(buf, "%d\n", (__s16)(desc->ld_default_stripe_count + 1) - 1); @@ -157,9 +157,9 @@ static ssize_t stripecount_show(struct kobject *kobj, struct attribute *attr, static ssize_t stripecount_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; int stripe_count; int rc; @@ -180,9 +180,9 @@ LUSTRE_RW_ATTR(stripecount); static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; return sprintf(buf, "%u\n", desc->ld_tgt_count); } @@ -191,9 +191,9 @@ LUSTRE_RO_ATTR(numobd); static ssize_t activeobd_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; return sprintf(buf, "%u\n", desc->ld_active_tgt_count); } @@ -202,9 +202,9 @@ LUSTRE_RO_ATTR(activeobd); static ssize_t desc_uuid_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct lov_desc *desc = &dev->u.lov.desc; + struct lov_desc *desc = &obd->u.lov.desc; return sprintf(buf, "%s\n", desc->ld_uuid.uuid); } @@ -213,15 +213,15 @@ LUSTRE_RO_ATTR(desc_uuid); #ifdef CONFIG_PROC_FS static void *lov_tgt_seq_start(struct seq_file *p, loff_t *pos) { - struct obd_device *dev = p->private; - struct lov_obd *lov = &dev->u.lov; - - while (*pos < lov->desc.ld_tgt_count) { - if (lov->lov_tgts[*pos]) - return lov->lov_tgts[*pos]; - ++*pos; - } - return NULL; + struct obd_device *obd = p->private; + struct lov_obd *lov = &obd->u.lov; + + while (*pos < lov->desc.ld_tgt_count) { + if (lov->lov_tgts[*pos]) + return lov->lov_tgts[*pos]; + ++*pos; + } + return NULL; } static void lov_tgt_seq_stop(struct seq_file *p, void *v) @@ -230,14 +230,14 @@ static void lov_tgt_seq_stop(struct seq_file *p, void *v) static void *lov_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos) { - struct obd_device *dev = p->private; - struct lov_obd *lov = &dev->u.lov; - - while (++*pos < lov->desc.ld_tgt_count) { - if (lov->lov_tgts[*pos]) - return lov->lov_tgts[*pos]; - } - return NULL; + struct obd_device *obd = p->private; + struct lov_obd *lov = &obd->u.lov; + + while (++*pos < lov->desc.ld_tgt_count) { + if (lov->lov_tgts[*pos]) + return lov->lov_tgts[*pos]; + } + return NULL; } static int lov_tgt_seq_show(struct seq_file *p, void *v) diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c index f5bae91..9de5c70 100644 --- a/lustre/mdc/lproc_mdc.c +++ b/lustre/mdc/lproc_mdc.c @@ -41,12 +41,12 @@ static ssize_t active_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); struct obd_import *imp; ssize_t len; - with_imp_locked(dev, imp, len) + with_imp_locked(obd, imp, len) len = sprintf(buf, "%d\n", !imp->imp_deactive); return len; } @@ -54,7 +54,7 @@ static ssize_t active_show(struct kobject *kobj, struct attribute *attr, static ssize_t active_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); bool val; int rc; @@ -64,8 +64,8 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr, return rc; /* opposite senses */ - if (dev->u.cli.cl_import->imp_deactive == val) - rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val); + if (obd->u.cli.cl_import->imp_deactive == val) + rc = ptlrpc_set_import_active(obd->u.cli.cl_import, val); else CDEBUG(D_CONFIG, "activate %u: ignoring repeat request\n", val); @@ -78,12 +78,12 @@ static ssize_t max_rpcs_in_flight_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); ssize_t len; u32 max; - max = obd_get_max_rpcs_in_flight(&dev->u.cli); + max = obd_get_max_rpcs_in_flight(&obd->u.cli); len = sprintf(buf, "%u\n", max); return len; @@ -94,7 +94,7 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); unsigned int val; int rc; @@ -103,7 +103,7 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj, if (rc) return rc; - rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val); + rc = obd_set_max_rpcs_in_flight(&obd->u.cli, val); if (rc) count = rc; @@ -115,11 +115,11 @@ static ssize_t max_mod_rpcs_in_flight_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); u16 max; - max = obd_get_max_mod_rpcs_in_flight(&dev->u.cli); + max = obd_get_max_mod_rpcs_in_flight(&obd->u.cli); return sprintf(buf, "%hu\n", max); } @@ -128,7 +128,7 @@ static ssize_t max_mod_rpcs_in_flight_store(struct kobject *kobj, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); u16 val; int rc; @@ -137,7 +137,7 @@ static ssize_t max_mod_rpcs_in_flight_store(struct kobject *kobj, if (rc) return rc; - rc = obd_set_max_mod_rpcs_in_flight(&dev->u.cli, val); + rc = obd_set_max_mod_rpcs_in_flight(&obd->u.cli, val); if (rc) count = rc; @@ -147,8 +147,8 @@ LUSTRE_RW_ATTR(max_mod_rpcs_in_flight); static int mdc_max_dirty_mb_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; unsigned long val; spin_lock(&cli->cl_loi_list_lock); @@ -164,8 +164,8 @@ static ssize_t mdc_max_dirty_mb_seq_write(struct file *file, size_t count, loff_t *off) { struct seq_file *sfl = file->private_data; - struct obd_device *dev = sfl->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = sfl->private; + struct client_obd *cli = &obd->u.cli; char kernbuf[22] = ""; u64 pages_number; int rc; @@ -236,8 +236,8 @@ LUSTRE_RW_ATTR(ping); static int mdc_cached_mb_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; int shift = 20 - PAGE_SHIFT; seq_printf(m, "used_mb: %ld\n" @@ -257,8 +257,8 @@ mdc_cached_mb_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { struct seq_file *sfl = file->private_data; - struct obd_device *dev = sfl->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = sfl->private; + struct client_obd *cli = &obd->u.cli; u64 pages_number; const char *tmp; long rc; @@ -296,8 +296,8 @@ LPROC_SEQ_FOPS(mdc_cached_mb); static int mdc_unstable_stats_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; long pages; int mb; @@ -315,8 +315,8 @@ static ssize_t mdc_rpc_stats_seq_write(struct file *file, size_t len, loff_t *off) { struct seq_file *seq = file->private_data; - struct obd_device *dev = seq->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = seq->private; + struct client_obd *cli = &obd->u.cli; lprocfs_oh_clear(&cli->cl_mod_rpcs_hist); @@ -332,12 +332,12 @@ static ssize_t mdc_rpc_stats_seq_write(struct file *file, static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v) { - struct obd_device *dev = seq->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = seq->private; + struct client_obd *cli = &obd->u.cli; unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum; int i; - obd_mod_rpc_stats_seq_show(&dev->u.cli, seq); + obd_mod_rpc_stats_seq_show(cli, seq); spin_lock(&cli->cl_loi_list_lock); @@ -427,8 +427,8 @@ LPROC_SEQ_FOPS(mdc_rpc_stats); static int mdc_stats_seq_show(struct seq_file *seq, void *v) { struct timespec64 now; - struct obd_device *dev = seq->private; - struct osc_stats *stats = &obd2osc_dev(dev)->od_stats; + struct obd_device *obd = seq->private; + struct osc_stats *stats = &obd2osc_dev(obd)->od_stats; ktime_get_real_ts64(&now); @@ -448,8 +448,8 @@ static ssize_t mdc_stats_seq_write(struct file *file, size_t len, loff_t *off) { struct seq_file *seq = file->private_data; - struct obd_device *dev = seq->private; - struct osc_stats *stats = &obd2osc_dev(dev)->od_stats; + struct obd_device *obd = seq->private; + struct osc_stats *stats = &obd2osc_dev(obd)->od_stats; memset(stats, 0, sizeof(*stats)); return len; @@ -458,9 +458,9 @@ LPROC_SEQ_FOPS(mdc_stats); static int mdc_dom_min_repsize_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = m->private; + struct obd_device *obd = m->private; - seq_printf(m, "%u\n", dev->u.cli.cl_dom_min_inline_repsize); + seq_printf(m, "%u\n", obd->u.cli.cl_dom_min_inline_repsize); return 0; } @@ -470,7 +470,7 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file, size_t count, loff_t *off) { struct seq_file *m = file->private_data; - struct obd_device *dev = m->private; + struct obd_device *obd = m->private; unsigned int val; int rc; @@ -481,7 +481,7 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file, if (val > MDC_DOM_MAX_INLINE_REPSIZE) return -ERANGE; - dev->u.cli.cl_dom_min_inline_repsize = val; + obd->u.cli.cl_dom_min_inline_repsize = val; return count; } LPROC_SEQ_FOPS(mdc_dom_min_repsize); diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index e3b04b0..b6b1c1c 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -252,21 +252,21 @@ static struct ptlrpc_request * mdc_intent_open_pack(struct obd_export *exp, struct lookup_intent *it, struct md_op_data *op_data, __u32 acl_bufsize) { - struct ptlrpc_request *req; - struct obd_device *obddev = class_exp2obd(exp); - struct ldlm_intent *lit; - const void *lmm = op_data->op_data; - __u32 lmmsize = op_data->op_data_size; - __u32 mdt_md_capsule_size; + struct ptlrpc_request *req; + struct obd_device *obd = class_exp2obd(exp); + struct ldlm_intent *lit; + const void *lmm = op_data->op_data; + __u32 lmmsize = op_data->op_data_size; + __u32 mdt_md_capsule_size; LIST_HEAD(cancels); - int count = 0; - enum ldlm_mode mode; - int rc; + int count = 0; + enum ldlm_mode mode; + int rc; int repsize, repsize_estimate; ENTRY; - mdt_md_capsule_size = obddev->u.cli.cl_default_mds_easize; + mdt_md_capsule_size = obd->u.cli.cl_default_mds_easize; it->it_create_mode = (it->it_create_mode & ~S_IFMT) | S_IFREG; @@ -317,7 +317,7 @@ mdc_intent_open_pack(struct obd_export *exp, struct lookup_intent *it, req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_CLIENT, 0); } else { req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_CLIENT, - max(lmmsize, obddev->u.cli.cl_default_mds_easize)); + max(lmmsize, obd->u.cli.cl_default_mds_easize)); } req_capsule_set_size(&req->rq_pill, &RMF_FILE_SECCTX_NAME, @@ -372,7 +372,7 @@ mdc_intent_open_pack(struct obd_export *exp, struct lookup_intent *it, op_data->op_file_secctx_name_size); req_capsule_set_size(&req->rq_pill, &RMF_FILE_SECCTX, RCL_SERVER, - obddev->u.cli.cl_max_mds_easize); + obd->u.cli.cl_max_mds_easize); CDEBUG(D_SEC, "packed '%.*s' as security xattr name\n", op_data->op_file_secctx_name_size, @@ -400,8 +400,8 @@ mdc_intent_open_pack(struct obd_export *exp, struct lookup_intent *it, sizeof(struct lov_comp_md_entry_v1) + lov_mds_md_size(0, LOV_MAGIC_V3)); - if (repsize_estimate < obddev->u.cli.cl_dom_min_inline_repsize) { - repsize = obddev->u.cli.cl_dom_min_inline_repsize - + if (repsize_estimate < obd->u.cli.cl_dom_min_inline_repsize) { + repsize = obd->u.cli.cl_dom_min_inline_repsize - repsize_estimate + sizeof(struct niobuf_remote); req_capsule_set_size(&req->rq_pill, &RMF_NIOBUF_INLINE, RCL_SERVER, @@ -510,7 +510,7 @@ mdc_intent_getattr_pack(struct obd_export *exp, struct lookup_intent *it, struct md_op_data *op_data, __u32 acl_bufsize) { struct ptlrpc_request *req; - struct obd_device *obddev = class_exp2obd(exp); + struct obd_device *obd = class_exp2obd(exp); u64 valid = OBD_MD_FLGETATTR | OBD_MD_FLEASIZE | OBD_MD_FLMODEASIZE | OBD_MD_FLDIREA | OBD_MD_MEA | OBD_MD_FLACL | OBD_MD_DEFAULT_MEA; @@ -551,7 +551,7 @@ mdc_intent_getattr_pack(struct obd_export *exp, struct lookup_intent *it, lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT); lit->opc = (__u64)it->it_op; - easize = obddev->u.cli.cl_default_mds_easize; + easize = obd->u.cli.cl_default_mds_easize; /* pack the intended request */ mdc_getattr_pack(req, valid, it->it_flags, op_data, easize); @@ -886,7 +886,7 @@ static int mdc_enqueue_base(struct obd_export *exp, struct lustre_handle *lockh, __u64 extra_lock_flags) { - struct obd_device *obddev = class_exp2obd(exp); + struct obd_device *obd = class_exp2obd(exp); struct ptlrpc_request *req; __u64 flags, saved_flags = extra_lock_flags; struct ldlm_res_id res_id; @@ -924,7 +924,7 @@ static int mdc_enqueue_base(struct obd_export *exp, policy = &lookup_policy; } - generation = obddev->u.cli.cl_import->imp_generation; + generation = obd->u.cli.cl_import->imp_generation; if (!it || (it->it_op & (IT_OPEN | IT_CREAT))) acl_bufsize = min_t(__u32, imp->imp_connect_data.ocd_max_easize, XATTR_SIZE_MAX); @@ -998,7 +998,7 @@ resend: if (rc < 0) { CDEBUG(D_INFO, "%s: ldlm_cli_enqueue "DFID":"DFID"=%s failed: rc = %d\n", - obddev->obd_name, PFID(&op_data->op_fid1), + obd->obd_name, PFID(&op_data->op_fid1), PFID(&op_data->op_fid2), op_data->op_name ?: "", rc); mdc_clear_replay_flag(req, rc); @@ -1018,13 +1018,13 @@ resend: if (it && (int)lockrep->lock_policy_res2 == -EINPROGRESS) { mdc_clear_replay_flag(req, rc); ptlrpc_req_finished(req); - if (generation == obddev->u.cli.cl_import->imp_generation) { + if (generation == obd->u.cli.cl_import->imp_generation) { if (signal_pending(current)) RETURN(-EINTR); resends++; CDEBUG(D_HA, "%s: resend:%d op:%d "DFID"/"DFID"\n", - obddev->obd_name, resends, it->it_op, + obd->obd_name, resends, it->it_op, PFID(&op_data->op_fid1), PFID(&op_data->op_fid2)); goto resend; diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 2c822cb..23e72e6 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -758,11 +758,12 @@ void class_obd_list(void) } /* Search for a client OBD connected to tgt_uuid. If grp_uuid is - specified, then only the client with that uuid is returned, - otherwise any client connected to the tgt is returned. */ -struct obd_device * class_find_client_obd(struct obd_uuid *tgt_uuid, - const char *type_name, - struct obd_uuid *grp_uuid) + * specified, then only the client with that uuid is returned, + * otherwise any client connected to the tgt is returned. + */ +struct obd_device *class_find_client_obd(struct obd_uuid *tgt_uuid, + const char *type_name, + struct obd_uuid *grp_uuid) { int i; @@ -790,10 +791,11 @@ struct obd_device * class_find_client_obd(struct obd_uuid *tgt_uuid, EXPORT_SYMBOL(class_find_client_obd); /* Iterate the obd_device list looking devices have grp_uuid. Start - searching at *next, and if a device is found, the next index to look - at is saved in *next. If next is NULL, then the first matching device - will always be returned. */ -struct obd_device * class_devices_in_group(struct obd_uuid *grp_uuid, int *next) + * searching at *next, and if a device is found, the next index to look + * at is saved in *next. If next is NULL, then the first matching device + * will always be returned. + */ +struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next) { int i; diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 32d9d5a..7fb8c0a 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -2260,14 +2260,14 @@ int lprocfs_seq_create(struct proc_dir_entry *parent, } EXPORT_SYMBOL(lprocfs_seq_create); -int lprocfs_obd_seq_create(struct obd_device *dev, +int lprocfs_obd_seq_create(struct obd_device *obd, const char *name, mode_t mode, const struct file_operations *seq_fops, void *data) { - return (lprocfs_seq_create(dev->obd_proc_entry, name, - mode, seq_fops, data)); + return lprocfs_seq_create(obd->obd_proc_entry, name, + mode, seq_fops, data); } EXPORT_SYMBOL(lprocfs_obd_seq_create); @@ -2338,8 +2338,8 @@ EXPORT_SYMBOL_GPL(lustre_sysfs_ops); int lprocfs_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *data) { - struct obd_device *dev = data; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = data; + struct client_obd *cli = &obd->u.cli; spin_lock(&cli->cl_loi_list_lock); seq_printf(m, "%d\n", cli->cl_max_pages_per_rpc); @@ -2353,8 +2353,8 @@ ssize_t lprocfs_obd_max_pages_per_rpc_seq_write(struct file *file, size_t count, loff_t *off) { struct seq_file *m = file->private_data; - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; struct obd_import *imp; struct obd_connect_data *ocd; int chunk_mask, rc; @@ -2377,7 +2377,7 @@ ssize_t lprocfs_obd_max_pages_per_rpc_seq_write(struct file *file, if (val >= ONE_MB_BRW_SIZE) val >>= PAGE_SHIFT; - with_imp_locked(dev, imp, rc) { + with_imp_locked(obd, imp, rc) { ocd = &imp->imp_connect_data; chunk_mask = ~((1 << (cli->cl_chunkbits - PAGE_SHIFT)) - 1); /* max_pages_per_rpc must be chunk aligned */ @@ -2400,9 +2400,9 @@ EXPORT_SYMBOL(lprocfs_obd_max_pages_per_rpc_seq_write); ssize_t short_io_bytes_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; int rc; spin_lock(&cli->cl_loi_list_lock); @@ -2418,9 +2418,9 @@ EXPORT_SYMBOL(short_io_bytes_show); ssize_t short_io_bytes_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; u64 val; int rc; diff --git a/lustre/obdecho/echo.c b/lustre/obdecho/echo.c index 4f069b9..f0978ad 100644 --- a/lustre/obdecho/echo.c +++ b/lustre/obdecho/echo.c @@ -121,13 +121,13 @@ static int echo_destroy_export(struct obd_export *exp) RETURN(0); } -static u64 echo_next_id(struct obd_device *obddev) +static u64 echo_next_id(struct obd_device *obd) { u64 id; - spin_lock(&obddev->u.echo.eo_lock); - id = ++obddev->u.echo.eo_lastino; - spin_unlock(&obddev->u.echo.eo_lock); + spin_lock(&obd->u.echo.eo_lock); + id = ++obd->u.echo.eo_lastino; + spin_unlock(&obd->u.echo.eo_lock); return id; } diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index b54261b..1d5f581 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -126,9 +126,9 @@ struct echo_md_device { #endif /* HAVE_SERVER_SUPPORT */ static int echo_client_setup(const struct lu_env *env, - struct obd_device *obddev, + struct obd_device *obd, struct lustre_cfg *lcfg); -static int echo_client_cleanup(struct obd_device *obddev); +static int echo_client_cleanup(struct obd_device *obd); /** \defgroup echo_helpers Helper functions * @{ @@ -740,9 +740,9 @@ out_free_seq: RETURN(rc); } -static int echo_fid_fini(struct obd_device *obddev) +static int echo_fid_fini(struct obd_device *obd) { - struct echo_device *ed = obd2echo_dev(obddev); + struct echo_device *ed = obd2echo_dev(obd); ENTRY; if (ed->ed_cl_seq) { @@ -2948,9 +2948,9 @@ out: } static int echo_client_setup(const struct lu_env *env, - struct obd_device *obddev, struct lustre_cfg *lcfg) + struct obd_device *obd, struct lustre_cfg *lcfg) { - struct echo_client_obd *ec = &obddev->u.echo_client; + struct echo_client_obd *ec = &obd->u.echo_client; struct obd_device *tgt; struct obd_uuid echo_uuid = { "ECHO_UUID" }; struct obd_connect_data *ocd = NULL; @@ -3022,10 +3022,10 @@ static int echo_client_setup(const struct lu_env *env, RETURN(rc); } -static int echo_client_cleanup(struct obd_device *obddev) +static int echo_client_cleanup(struct obd_device *obd) { - struct echo_device *ed = obd2echo_dev(obddev); - struct echo_client_obd *ec = &obddev->u.echo_client; + struct echo_device *ed = obd2echo_dev(obd); + struct echo_client_obd *ec = &obd->u.echo_client; int rc; ENTRY; @@ -3045,7 +3045,7 @@ static int echo_client_cleanup(struct obd_device *obddev) RETURN(0); } - if (!list_empty(&obddev->obd_exports)) { + if (!list_empty(&obd->obd_exports)) { CERROR("still has clients!\n"); RETURN(-EBUSY); } diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index b934243..b3eae69 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -44,12 +44,12 @@ static ssize_t active_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); struct obd_import *imp; int rc; - with_imp_locked(dev, imp, rc) + with_imp_locked(obd, imp, rc) rc = sprintf(buf, "%d\n", !imp->imp_deactive); return rc; @@ -58,7 +58,7 @@ static ssize_t active_show(struct kobject *kobj, struct attribute *attr, static ssize_t active_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); bool val; int rc; @@ -68,8 +68,8 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr, return rc; /* opposite senses */ - if (dev->u.cli.cl_import->imp_deactive == val) - rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val); + if (obd->u.cli.cl_import->imp_deactive == val) + rc = ptlrpc_set_import_active(obd->u.cli.cl_import, val); else CDEBUG(D_CONFIG, "activate %u: ignoring repeat request\n", (unsigned int)val); @@ -82,9 +82,9 @@ static ssize_t max_rpcs_in_flight_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; ssize_t len; spin_lock(&cli->cl_loi_list_lock); @@ -98,9 +98,9 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; int adding, added, req_count; unsigned int val; int rc; @@ -139,9 +139,9 @@ static ssize_t max_dirty_mb_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; unsigned long val; spin_lock(&cli->cl_loi_list_lock); @@ -156,9 +156,9 @@ static ssize_t max_dirty_mb_store(struct kobject *kobj, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; unsigned long pages_number, max_dirty_mb; int rc; @@ -188,8 +188,8 @@ LUSTRE_RW_ATTR(ping); static int osc_cached_mb_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; int shift = 20 - PAGE_SHIFT; seq_printf(m, "used_mb: %ld\n" @@ -209,8 +209,8 @@ static ssize_t osc_cached_mb_seq_write(struct file *file, size_t count, loff_t *off) { struct seq_file *m = file->private_data; - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; u64 pages_number; const char *tmp; long rc; @@ -251,9 +251,9 @@ static ssize_t cur_dirty_bytes_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; ssize_t len; spin_lock(&cli->cl_loi_list_lock); @@ -266,8 +266,8 @@ LUSTRE_RO_ATTR(cur_dirty_bytes); static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; spin_lock(&cli->cl_loi_list_lock); seq_printf(m, "%lu\n", cli->cl_avail_grant); @@ -322,9 +322,9 @@ static ssize_t cur_lost_grant_bytes_show(struct kobject *kobj, struct attribute *attr, char *buf) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); - struct client_obd *cli = &dev->u.cli; + struct client_obd *cli = &obd->u.cli; ssize_t len; spin_lock(&cli->cl_loi_list_lock); @@ -603,8 +603,8 @@ LUSTRE_RW_ATTR(short_io_bytes); #ifdef CONFIG_PROC_FS static int osc_unstable_stats_seq_show(struct seq_file *m, void *v) { - struct obd_device *dev = m->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = m->private; + struct client_obd *cli = &obd->u.cli; long pages; int mb; @@ -635,7 +635,7 @@ static ssize_t idle_timeout_show(struct kobject *kobj, struct attribute *attr, static ssize_t idle_timeout_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); struct obd_import *imp; struct ptlrpc_request *req; @@ -656,7 +656,7 @@ static ssize_t idle_timeout_store(struct kobject *kobj, struct attribute *attr, return -ERANGE; } - with_imp_locked(dev, imp, rc) { + with_imp_locked(obd, imp, rc) { if (idle_debug) { imp->imp_idle_debug = idle_debug; } else { @@ -678,13 +678,13 @@ LUSTRE_RW_ATTR(idle_timeout); static ssize_t idle_connect_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); struct obd_import *imp; struct ptlrpc_request *req; int rc; - with_imp_locked(dev, imp, rc) { + with_imp_locked(obd, imp, rc) { /* to initiate the connection if it's in IDLE state */ req = ptlrpc_request_alloc(imp, &RQF_OST_STATFS); if (req) @@ -716,20 +716,20 @@ static ssize_t grant_shrink_show(struct kobject *kobj, struct attribute *attr, static ssize_t grant_shrink_store(struct kobject *kobj, struct attribute *attr, const char *buffer, size_t count) { - struct obd_device *dev = container_of(kobj, struct obd_device, + struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); struct obd_import *imp; bool val; int rc; - if (dev == NULL) + if (obd == NULL) return 0; rc = kstrtobool(buffer, &val); if (rc) return rc; - with_imp_locked(dev, imp, rc) { + with_imp_locked(obd, imp, rc) { spin_lock(&imp->imp_lock); imp->imp_grant_shrink_disabled = !val; spin_unlock(&imp->imp_lock); @@ -776,8 +776,8 @@ struct lprocfs_vars lprocfs_osc_obd_vars[] = { static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) { struct timespec64 now; - struct obd_device *dev = seq->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = seq->private; + struct client_obd *cli = &obd->u.cli; unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum; int i; @@ -874,26 +874,26 @@ static ssize_t osc_rpc_stats_seq_write(struct file *file, const char __user *buf, size_t len, loff_t *off) { - struct seq_file *seq = file->private_data; - struct obd_device *dev = seq->private; - struct client_obd *cli = &dev->u.cli; + struct seq_file *seq = file->private_data; + struct obd_device *obd = seq->private; + struct client_obd *cli = &obd->u.cli; - lprocfs_oh_clear(&cli->cl_read_rpc_hist); - lprocfs_oh_clear(&cli->cl_write_rpc_hist); - lprocfs_oh_clear(&cli->cl_read_page_hist); - lprocfs_oh_clear(&cli->cl_write_page_hist); - lprocfs_oh_clear(&cli->cl_read_offset_hist); - lprocfs_oh_clear(&cli->cl_write_offset_hist); + lprocfs_oh_clear(&cli->cl_read_rpc_hist); + lprocfs_oh_clear(&cli->cl_write_rpc_hist); + lprocfs_oh_clear(&cli->cl_read_page_hist); + lprocfs_oh_clear(&cli->cl_write_page_hist); + lprocfs_oh_clear(&cli->cl_read_offset_hist); + lprocfs_oh_clear(&cli->cl_write_offset_hist); - return len; + return len; } LPROC_SEQ_FOPS(osc_rpc_stats); static int osc_stats_seq_show(struct seq_file *seq, void *v) { struct timespec64 now; - struct obd_device *dev = seq->private; - struct osc_stats *stats = &obd2osc_dev(dev)->od_stats; + struct obd_device *obd = seq->private; + struct osc_stats *stats = &obd2osc_dev(obd)->od_stats; ktime_get_real_ts64(&now); @@ -912,25 +912,25 @@ static ssize_t osc_stats_seq_write(struct file *file, const char __user *buf, size_t len, loff_t *off) { - struct seq_file *seq = file->private_data; - struct obd_device *dev = seq->private; - struct osc_stats *stats = &obd2osc_dev(dev)->od_stats; + struct seq_file *seq = file->private_data; + struct obd_device *obd = seq->private; + struct osc_stats *stats = &obd2osc_dev(obd)->od_stats; - memset(stats, 0, sizeof(*stats)); - return len; + memset(stats, 0, sizeof(*stats)); + return len; } LPROC_SEQ_FOPS(osc_stats); -int lprocfs_osc_attach_seqstat(struct obd_device *dev) +int lprocfs_osc_attach_seqstat(struct obd_device *obd) { int rc; - rc = lprocfs_seq_create(dev->obd_proc_entry, "osc_stats", 0644, - &osc_stats_fops, dev); + rc = lprocfs_seq_create(obd->obd_proc_entry, "osc_stats", 0644, + &osc_stats_fops, obd); if (rc == 0) - rc = lprocfs_obd_seq_create(dev, "rpc_stats", 0644, - &osc_rpc_stats_fops, dev); + rc = lprocfs_obd_seq_create(obd, "rpc_stats", 0644, + &osc_rpc_stats_fops, obd); return rc; } diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index 30e5f07..dcc5d07 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -1239,11 +1239,11 @@ void ptlrpc_ldebugfs_register_service(struct dentry *entry, CWARN("Error adding the req_history file\n"); } -void ptlrpc_lprocfs_register_obd(struct obd_device *obddev) +void ptlrpc_lprocfs_register_obd(struct obd_device *obd) { - ptlrpc_ldebugfs_register(obddev->obd_debugfs_entry, NULL, "stats", - &obddev->obd_svc_debugfs_entry, - &obddev->obd_svc_stats); + ptlrpc_ldebugfs_register(obd->obd_debugfs_entry, NULL, "stats", + &obd->obd_svc_debugfs_entry, + &obd->obd_svc_stats); } EXPORT_SYMBOL(ptlrpc_lprocfs_register_obd); diff --git a/lustre/ptlrpc/sec_lproc.c b/lustre/ptlrpc/sec_lproc.c index e3d99ac..fdce982 100644 --- a/lustre/ptlrpc/sec_lproc.c +++ b/lustre/ptlrpc/sec_lproc.c @@ -69,16 +69,16 @@ static char *sec_flags2str(unsigned long flags, char *buf, int bufsize) static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v) { - struct obd_device *dev = seq->private; - struct client_obd *cli = &dev->u.cli; - struct ptlrpc_sec *sec = NULL; - char str[32]; + struct obd_device *obd = seq->private; + struct client_obd *cli = &obd->u.cli; + struct ptlrpc_sec *sec = NULL; + char str[32]; - LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) == 0); + LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) == 0); if (cli->cl_import) sec = sptlrpc_import_sec_ref(cli->cl_import); @@ -111,15 +111,15 @@ LPROC_SEQ_FOPS_RO(sptlrpc_info_lprocfs); static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v) { - struct obd_device *dev = seq->private; - struct client_obd *cli = &dev->u.cli; - struct ptlrpc_sec *sec = NULL; + struct obd_device *obd = seq->private; + struct client_obd *cli = &obd->u.cli; + struct ptlrpc_sec *sec = NULL; - LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) == 0); + LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 || + strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) == 0); if (cli->cl_import) sec = sptlrpc_import_sec_ref(cli->cl_import); @@ -141,8 +141,8 @@ lprocfs_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 *dev = seq->private; - struct client_obd *cli = &dev->u.cli; + struct obd_device *obd = seq->private; + struct client_obd *cli = &obd->u.cli; struct obd_import *imp = cli->cl_import; struct sepol_downcall_data *param; int size = sizeof(*param); @@ -150,7 +150,7 @@ lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer, if (count < size) { CERROR("%s: invalid data count = %lu, size = %d\n", - dev->obd_name, (unsigned long) count, size); + obd->obd_name, (unsigned long) count, size); return -EINVAL; } @@ -159,20 +159,20 @@ lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer, return -ENOMEM; if (copy_from_user(param, buffer, size)) { - CERROR("%s: bad sepol data\n", dev->obd_name); + CERROR("%s: bad sepol data\n", obd->obd_name); GOTO(out, rc = -EFAULT); } if (param->sdd_magic != SEPOL_DOWNCALL_MAGIC) { CERROR("%s: sepol downcall bad params\n", - dev->obd_name); + obd->obd_name); GOTO(out, rc = -EINVAL); } if (param->sdd_sepol_len == 0 || param->sdd_sepol_len >= sizeof(imp->imp_sec->ps_sepol)) { CERROR("%s: invalid sepol data returned\n", - dev->obd_name); + obd->obd_name); GOTO(out, rc = -EINVAL); } rc = param->sdd_sepol_len; /* save sdd_sepol_len */ @@ -187,7 +187,7 @@ lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer, return -ENOMEM; if (copy_from_user(param, buffer, size)) { - CERROR("%s: bad sepol data\n", dev->obd_name); + CERROR("%s: bad sepol data\n", obd->obd_name); GOTO(out, rc = -EFAULT); } @@ -205,41 +205,41 @@ out: } LPROC_SEQ_FOPS_WR_ONLY(srpc, sptlrpc_sepol); -int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev) +int sptlrpc_lprocfs_cliobd_attach(struct obd_device *obd) { int rc; - if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 && - strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 && - strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) != 0 && - strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) != 0 && - strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) != 0) { + if (strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 && + strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 && + strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME) != 0 && + strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) != 0 && + strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) != 0) { CERROR("can't register lproc for obd type %s\n", - dev->obd_type->typ_name); + obd->obd_type->typ_name); return -EINVAL; } - rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "srpc_info", 0444, - &sptlrpc_info_lprocfs_fops, dev); + rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "srpc_info", 0444, + &sptlrpc_info_lprocfs_fops, obd); if (rc) { CERROR("create proc entry srpc_info for %s: %d\n", - dev->obd_name, rc); + obd->obd_name, rc); return rc; } - rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "srpc_contexts", - 0444, &sptlrpc_ctxs_lprocfs_fops, dev); + rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "srpc_contexts", + 0444, &sptlrpc_ctxs_lprocfs_fops, obd); if (rc) { CERROR("create proc entry srpc_contexts for %s: %d\n", - dev->obd_name, rc); + obd->obd_name, rc); return rc; } - rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "srpc_sepol", - 0200, &srpc_sptlrpc_sepol_fops, dev); + rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "srpc_sepol", + 0200, &srpc_sptlrpc_sepol_fops, obd); if (rc) { CERROR("create proc entry srpc_sepol for %s: %d\n", - dev->obd_name, rc); + obd->obd_name, rc); return rc; } -- 1.8.3.1