static void osd_object_read_lock(const struct lu_env *env, struct dt_object *dt, unsigned role) { struct osd_object *obj = osd_dt_obj(dt); LASSERT(osd_invariant(obj)); down_read_nested(&obj->oo_sem, role); }
/** * Implementation of dt_object_operations::do_read_lock * * osp_md_object_{read,write}_lock() will only lock the remote object in the * local cache, which uses the semaphore (opo_sem) inside the osp_object to * lock the object. Note: it will not lock the object in the whole cluster, * which relies on the LDLM lock. * * \param[in] env execution environment * \param[in] dt object to be locked * \param[in] role lock role from MDD layer, see mdd_object_role(). */ static void osp_md_object_read_lock(const struct lu_env *env, struct dt_object *dt, unsigned role) { struct osp_object *obj = dt2osp_obj(dt); LASSERT(obj->opo_owner != env); down_read_nested(&obj->opo_sem, role); LASSERT(obj->opo_owner == NULL); }