Esempio n. 1
0
static struct lu_device *osc_device_free(const struct lu_env *env,
					 struct lu_device *d)
{
	struct osc_device *od = lu2osc_dev(d);

	cl_device_fini(lu2cl_dev(d));
	kfree(od);
	return NULL;
}
Esempio n. 2
0
static struct lu_device *lov_device_free(const struct lu_env *env,
					 struct lu_device *d)
{
	struct lov_device *ld = lu2lov_dev(d);
	const int	  nr = ld->ld_target_nr;

	cl_device_fini(lu2cl_dev(d));
	kfree(ld->ld_target);
	if (ld->ld_emrg != NULL)
		lov_emerg_free(ld->ld_emrg, nr);
	kfree(ld);
	return NULL;
}
static struct lu_device *lovsub_device_free(const struct lu_env *env,
					    struct lu_device *d)
{
	struct lovsub_device *lsd  = lu2lovsub_dev(d);
	struct lu_device     *next = cl2lu_dev(lsd->acid_next);

	if (atomic_read(&d->ld_ref) && d->ld_site) {
		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_ERROR, NULL);
		lu_site_print(env, d->ld_site, &msgdata, lu_cdebug_printer);
	}
	cl_device_fini(lu2cl_dev(d));
	OBD_FREE_PTR(lsd);
	return next;
}
Esempio n. 4
0
static struct lu_device *lov_device_free(const struct lu_env *env,
					 struct lu_device *d)
{
	struct lov_device *ld = lu2lov_dev(d);
	const int	  nr = ld->ld_target_nr;

	cl_device_fini(lu2cl_dev(d));
	if (ld->ld_target != NULL)
		OBD_FREE(ld->ld_target, nr * sizeof(ld->ld_target[0]));
	if (ld->ld_emrg != NULL)
		lov_emerg_free(ld->ld_emrg, nr);
	OBD_FREE_PTR(ld);
	return NULL;
}
Esempio n. 5
0
static struct lu_device *vvp_device_free(const struct lu_env *env,
					 struct lu_device *d)
{
	struct vvp_device *vdv  = lu2vvp_dev(d);
	struct cl_site    *site = lu2cl_site(d->ld_site);
	struct lu_device  *next = cl2lu_dev(vdv->vdv_next);

	if (d->ld_site) {
		cl_site_fini(site);
		kfree(site);
	}
	cl_device_fini(lu2cl_dev(d));
	kfree(vdv);
	return next;
}