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);
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);
{ 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;
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; }
* 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 *,
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);
}
/* 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
__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);
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);
/* 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);
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 *));
* 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,
} 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;
}
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));
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);
}
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;
}
}
- 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);
}
}
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();
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;
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;
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:
/* 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) {
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;
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);
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,
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;
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;
}
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,
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;
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,
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;
#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) {
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;
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)
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);
}
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;
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;
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;
rc = -EINVAL;
}
- lov_tgts_putref(obddev);
+ lov_tgts_putref(obd);
RETURN(rc);
}
__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;
RETURN(-ENOMEM);
}
- lov_tgts_getref(obddev);
+ lov_tgts_getref(obd);
if (KEY_IS(KEY_CHECKSUM))
do_inactive = true;
rc = err;
}
- lov_tgts_putref(obddev);
+ lov_tgts_putref(obd);
if (no_set) {
err = ptlrpc_set_wait(env, set);
if (rc == 0)
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;
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;
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);
}
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;
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);
}
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;
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);
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;
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);
}
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);
}
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);
}
#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)
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)
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;
}
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;
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);
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;
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;
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;
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);
}
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;
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;
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);
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;
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"
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;
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;
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);
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);
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);
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;
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;
}
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;
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);
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;
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,
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,
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,
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;
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);
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;
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);
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);
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;
}
/* 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;
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;
}
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);
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);
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;
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 */
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);
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;
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;
}
#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
* @{
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) {
}
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;
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;
RETURN(0);
}
- if (!list_empty(&obddev->obd_exports)) {
+ if (!list_empty(&obd->obd_exports)) {
CERROR("still has clients!\n");
RETURN(-EBUSY);
}
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;
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;
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);
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);
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;
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);
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;
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"
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;
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);
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);
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);
#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;
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;
return -ERANGE;
}
- with_imp_locked(dev, imp, rc) {
+ with_imp_locked(obd, imp, rc) {
if (idle_debug) {
imp->imp_idle_debug = idle_debug;
} else {
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)
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);
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;
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);
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;
}
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);
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);
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);
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);
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;
}
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 */
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);
}
}
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;
}