Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-8066 obd: embed typ_kobj in obd_type
[fs/lustre-release.git]
/
lustre
/
osp
/
osp_dev.c
diff --git
a/lustre/osp/osp_dev.c
b/lustre/osp/osp_dev.c
index
cb475de
..
0aaf162
100644
(file)
--- a/
lustre/osp/osp_dev.c
+++ b/
lustre/osp/osp_dev.c
@@
-1010,7
+1010,6
@@
static int osp_init0(const struct lu_env *env, struct osp_device *osp,
{
struct obd_device *obd;
struct obd_import *imp;
- class_uuid_t uuid;
char *src, *tgt, *mdt, *osdname = NULL;
int rc;
long idx;
@@
-1202,9
+1201,6
@@
static int osp_init0(const struct lu_env *env, struct osp_device *osp,
/*
* Initiate connect to OST
*/
- ll_generate_random_uuid(uuid);
- class_uuid_unparse(uuid, &osp->opd_cluuid);
-
imp = obd->u.cli.cl_import;
rc = ptlrpc_init_import(imp);
@@
-1679,9
+1675,6
@@
static int osp_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
rc = ptlrpc_set_import_active(obd->u.cli.cl_import,
data->ioc_offset);
break;
- case OBD_IOC_PING_TARGET:
- rc = ptlrpc_obd_ping(obd);
- break;
default:
CERROR("%s: unrecognized ioctl %#x by %s\n", obd->obd_name,
cmd, current_comm());
@@
-1888,7
+1881,7
@@
static struct obd_ops osp_obd_device_ops = {
.o_fid_alloc = osp_fid_alloc,
};
-static struct obd_type sym;
+static struct obd_type
*
sym;
/**
* Initialize OSP module.
@@
-1906,7
+1899,6
@@
static int __init osp_init(void)
{
struct dentry *symlink;
struct obd_type *type;
- struct kobject *kobj;
struct qstr dname;
int rc;
@@
-1929,6
+1921,15
@@
static int __init osp_init(void)
return rc;
}
+ sym = class_setup_tunables(LUSTRE_OSC_NAME);
+ if (IS_ERR(sym)) {
+ rc = PTR_ERR(sym);
+ /* does real "osc" already exist ? */
+ if (rc == -EEXIST)
+ GOTO(try_proc, rc = 0);
+ GOTO(no_osc, rc);
+ }
+
/* create "osc" entry for compatibility purposes */
dname.name = "osc";
dname.len = strlen(dname.name);
@@
-1941,26
+1942,11
@@
static int __init osp_init(void)
rc = symlink ? PTR_ERR(symlink) : -ENOMEM;
GOTO(no_osc, rc);
}
- sym
.
typ_debugfs_entry = symlink;
+ sym
->
typ_debugfs_entry = symlink;
} else {
dput(symlink);
}
- kobj = kset_find_obj(lustre_kset, dname.name);
- if (kobj) {
- kobject_put(kobj);
- goto try_proc;
- }
-
- kobj = class_setup_tunables(dname.name);
- if (IS_ERR(kobj)) {
- rc = PTR_ERR(kobj);
- if (sym.typ_debugfs_entry)
- ldebugfs_remove(&sym.typ_debugfs_entry);
- GOTO(no_osc, rc);
- }
- sym.typ_kobj = kobj;
-
try_proc:
type = class_search_type(LUSTRE_OSC_NAME);
if (type != NULL && type->typ_procroot != NULL)
@@
-1986,8
+1972,10
@@
no_osc:
*/
static void __exit osp_exit(void)
{
- ldebugfs_remove(&sym.typ_debugfs_entry);
- kobject_put(sym.typ_kobj);
+ if (!IS_ERR_OR_NULL(sym)) {
+ ldebugfs_remove(&sym->typ_debugfs_entry);
+ kobject_put(&sym->typ_kobj);
+ }
class_unregister_type(LUSTRE_LWP_NAME);
class_unregister_type(LUSTRE_OSP_NAME);
lu_kmem_fini(osp_caches);