X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flov%2Flov_dev.c;h=97d220c8a242be0be66a8b3f7a0722aff6198f9f;hb=7446b87524ba992b96b90a508a51d48d86b90865;hp=6aa4431c1e6ea7fe5cb955867a589cceca7b89ea;hpb=e97152e1766de834001f5c4cdb3a6e38b5ecb2f2;p=fs%2Flustre-release.git diff --git a/lustre/lov/lov_dev.c b/lustre/lov/lov_dev.c index 6aa4431..97d220c 100644 --- a/lustre/lov/lov_dev.c +++ b/lustre/lov/lov_dev.c @@ -26,7 +26,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -60,7 +60,7 @@ cfs_mem_cache_t *lovsub_req_kmem; cfs_mem_cache_t *lov_lock_link_kmem; /** Lock class of lov_device::ld_mutex. */ -struct lock_class_key cl_lov_device_mutex_class; +cfs_lock_class_key_t cl_lov_device_mutex_class; struct lu_kmem_descr lov_caches[] = { { @@ -167,7 +167,7 @@ static void lov_key_fini(const struct lu_context *ctx, struct lu_context_key *key, void *data) { struct lov_thread_info *info = data; - LINVRNT(list_empty(&info->lti_closure.clc_list)); + LINVRNT(cfs_list_empty(&info->lti_closure.clc_list)); OBD_SLAB_FREE_PTR(info, lov_thread_kmem); } @@ -343,16 +343,13 @@ static struct lov_device_emerg **lov_emerg_alloc(int nr) return ERR_PTR(-ENOMEM); for (result = i = 0; i < nr && result == 0; i++) { struct lov_device_emerg *em; - void *cookie; OBD_ALLOC_PTR(em); if (em != NULL) { emerg[i] = em; cl_page_list_init(&em->emrg_page_list); - cookie = cl_env_reenter(); em->emrg_env = cl_env_alloc(&em->emrg_refcheck, LCT_REMEMBER|LCT_NOREF); - cl_env_reexit(cookie); if (!IS_ERR(em->emrg_env)) em->emrg_env->le_ctx.lc_cookie = 0x2; else { @@ -390,7 +387,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev) OBD_ALLOC(newd, tgt_size * sz); if (newd != NULL) { - mutex_lock(&dev->ld_mutex); + cfs_mutex_lock(&dev->ld_mutex); if (sub_size > 0) { memcpy(newd, dev->ld_target, sub_size * sz); OBD_FREE(dev->ld_target, sub_size * sz); @@ -401,7 +398,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev) if (dev->ld_emrg != NULL) lov_emerg_free(dev->ld_emrg, sub_size); dev->ld_emrg = emerg; - mutex_unlock(&dev->ld_mutex); + cfs_mutex_unlock(&dev->ld_mutex); } else { lov_emerg_free(emerg, tgt_size); result = -ENOMEM; @@ -507,8 +504,8 @@ static struct lu_device *lov_device_alloc(const struct lu_env *env, d->ld_ops = &lov_lu_ops; ld->ld_cl.cd_ops = &lov_cl_ops; - mutex_init(&ld->ld_mutex); - lockdep_set_class(&ld->ld_mutex, &cl_lov_device_mutex_class); + cfs_mutex_init(&ld->ld_mutex); + cfs_lockdep_set_class(&ld->ld_mutex, &cl_lov_device_mutex_class); /* setup the LOV OBD */ obd = class_name2obd(lustre_cfg_string(cfg, 0));