static struct cl_object *lov_sub_find(const struct lu_env *env, struct cl_device *dev, const struct lu_fid *fid, const struct cl_object_conf *conf) { struct lu_object *o; o = lu_object_find_at(env, cl2lu_dev(dev), fid, &conf->coc_lu); LASSERT(ergo(!IS_ERR(o), o->lo_dev->ld_type == &lovsub_device_type)); return lu2cl(o); }
static struct lu_device *lovsub_device_fini(const struct lu_env *env, struct lu_device *d) { struct lu_device *next; struct lovsub_device *lsd; ENTRY; lsd = lu2lovsub_dev(d); next = cl2lu_dev(lsd->acid_next); lsd->acid_next = NULL; RETURN(next); }
static struct lu_device *lovsub_device_fini(const struct lu_env *env, struct lu_device *d) { struct lu_device *next; struct lovsub_device *lsd; lsd = lu2lovsub_dev(d); next = cl2lu_dev(lsd->acid_next); lsd->acid_super = NULL; lsd->acid_next = NULL; return next; }
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; }
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; }
int cl_sb_init(struct llu_sb_info *sbi) { struct cl_device *cl; struct lu_env *env; int rc = 0; int refcheck; env = cl_env_get(&refcheck); if (IS_ERR(env)) RETURN(PTR_ERR(env)); cl = cl_type_setup(env, NULL, &slp_device_type, sbi->ll_dt_exp->exp_obd->obd_lu_dev); if (IS_ERR(cl)) GOTO(out, rc = PTR_ERR(cl)); sbi->ll_cl = cl; sbi->ll_site = cl2lu_dev(cl)->ld_site; out: cl_env_put(env, &refcheck); RETURN(rc); }
int cl_sb_init(struct super_block *sb) { struct ll_sb_info *sbi; struct cl_device *cl; struct lu_env *env; int rc = 0; u16 refcheck; sbi = ll_s2sbi(sb); env = cl_env_get(&refcheck); if (!IS_ERR(env)) { cl = cl_type_setup(env, NULL, &vvp_device_type, sbi->ll_dt_exp->exp_obd->obd_lu_dev); if (!IS_ERR(cl)) { sbi->ll_cl = cl; sbi->ll_site = cl2lu_dev(cl)->ld_site; } cl_env_put(env, &refcheck); } else { rc = PTR_ERR(env); } return rc; }
static struct lu_device *vvp_device_fini(const struct lu_env *env, struct lu_device *d) { return cl2lu_dev(lu2vvp_dev(d)->vdv_next); }