Whamcloud - gitweb
LU-8066 obd: embed typ_kobj in obd_type 12/34612/7
authorNeilBrown <neilb@suse.com>
Tue, 30 Apr 2019 15:09:25 +0000 (11:09 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 8 May 2019 06:05:16 +0000 (06:05 +0000)
commit392dab3c01bb802892466f9a05ef1b56406b8522
tree4318fb0ae7dec7e2f0792d87c994be15d3cfa629
parentf1ca2c0bd059e3606225127e5ff72b4db9a1ed6e
LU-8066 obd: embed typ_kobj in obd_type

As there is a 1-1 mapping between obd_types and their ->typ_kobj, it
is simple and more normal to embed the kobj in the obd_type, rather
than allocate it separately.

This requires calling "kobject_init_and_add()" earlier, so we
open-code relevant part of class_setup_tunables() in
class_register_type(). Now class_setup_tunables() is needed only
for server side code.

With typ_kobj embedded in obd_type we change class_setup_tunables()
to return an obd_type object instead of a kobject. This way we
can use kobject_put() to cleanup the obd_type created with
class_setup_tunables(). The reason for class_setup_tunables() is
for the creation of a lightweight obd_type which is never added
to the typ_chain list to avoid potential duplicates which can
happen on single node setups with lod / lov and osp /osc.

Change-Id: Iac160e6817a7c520e4462a3fc133ddfee6a7ccdc
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/34612
Reviewed-by: Ben Evans <bevans@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd.h
lustre/include/obd_class.h
lustre/lod/lod_dev.c
lustre/mdd/mdd_lproc.c
lustre/obdclass/dt_object.c
lustre/obdclass/genops.c
lustre/obdclass/lprocfs_status.c
lustre/osp/osp_dev.c