Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b801302 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman
Browse files

staging/lustre/obdclass: Prepare for procfs to sysfs migration



Add necessary plumbing to register obd types and instances
under /sys/fs/lustre

Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b8c7ceda
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ struct lprocfs_vars {

struct lprocfs_static_vars {
	struct lprocfs_vars *obd_vars;
	struct attribute_group *sysfs_vars;
};

/* if we find more consumers this could be generalized */
@@ -605,7 +606,8 @@ extern void lprocfs_remove(struct proc_dir_entry **root);
extern void lprocfs_remove_proc_entry(const char *name,
				      struct proc_dir_entry *parent);

extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list);
extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
			     struct attribute_group *attrs);
extern int lprocfs_obd_cleanup(struct obd_device *obd);

extern int ldebugfs_seq_create(struct dentry *parent,
+4 −0
Original line number Diff line number Diff line
@@ -249,6 +249,7 @@ struct obd_type {
	int  typ_refcnt;
	struct lu_device_type *typ_lu;
	spinlock_t obd_type_lock;
	struct kobject *typ_kobj;
};

struct brw_page {
@@ -936,6 +937,9 @@ struct obd_device {
	struct lu_ref	  obd_reference;

	int		       obd_conn_inprogress;

	struct kobject		obd_kobj; /* sysfs object */
	struct completion	obd_kobj_unregister;
};

#define OBD_LLOG_FL_SENDNOW     0x0001
+2 −2
Original line number Diff line number Diff line
@@ -1309,7 +1309,7 @@ int lmv_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
{
	struct lmv_obd	     *lmv = &obd->u.lmv;
	struct lprocfs_static_vars  lvars;
	struct lprocfs_static_vars  lvars = { NULL };
	struct lmv_desc	    *desc;
	int			 rc;

@@ -1343,7 +1343,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)

	lprocfs_lmv_init_vars(&lvars);

	lprocfs_obd_setup(obd, lvars.obd_vars);
	lprocfs_obd_setup(obd, lvars.obd_vars, lvars.sysfs_vars);
#if defined (CONFIG_PROC_FS)
	{
		rc = lprocfs_seq_create(obd->obd_proc_entry, "target_obd",
+1 −1
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
		goto out;

	lprocfs_lov_init_vars(&lvars);
	lprocfs_obd_setup(obd, lvars.obd_vars);
	lprocfs_obd_setup(obd, lvars.obd_vars, lvars.sysfs_vars);
#if defined (CONFIG_PROC_FS)
	{
		int rc1;
+1 −1
Original line number Diff line number Diff line
@@ -2447,7 +2447,7 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
	if (rc)
		goto err_close_lock;
	lprocfs_mdc_init_vars(&lvars);
	lprocfs_obd_setup(obd, lvars.obd_vars);
	lprocfs_obd_setup(obd, lvars.obd_vars, lvars.sysfs_vars);
	sptlrpc_lprocfs_cliobd_attach(obd);
	ptlrpc_lprocfs_register_obd(obd);

Loading