X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Fmd_local_object.c;h=5b4f3495fa02d15de13707b969007fd882831fe2;hp=1372e2c7055bd737df37dc8bf43d53f24234c085;hb=ad30b8adb2d658659c900b3d1f830bcb976b21f8;hpb=df18269e914dd7c99a4ec715952bb498172c183a diff --git a/lustre/obdclass/md_local_object.c b/lustre/obdclass/md_local_object.c index 1372e2c..5b4f349 100644 --- a/lustre/obdclass/md_local_object.c +++ b/lustre/obdclass/md_local_object.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. */ /* @@ -56,10 +56,10 @@ /** List head to hold list of objects to be created. */ -static struct list_head llo_lobj_list; +static cfs_list_t llo_lobj_list; /** Lock to protect list manipulations */ -static struct mutex llo_lock; +static cfs_mutex_t llo_lock; /** * Structure used to maintain state of path parsing. @@ -91,7 +91,7 @@ LU_KEY_INIT(llod_global, struct llo_thread_info); LU_KEY_FINI(llod_global, struct llo_thread_info); static struct lu_context_key llod_key = { - .lct_tags = LCT_MD_THREAD | LCT_DT_THREAD, + .lct_tags = LCT_MD_THREAD, .lct_init = llod_global_key_init, .lct_fini = llod_global_key_fini }; @@ -318,7 +318,7 @@ static struct md_object *llo_create_obj(const struct lu_env *env, * special index defined by \a feat in \a directory. * * \param md device - * \param dir parent directory + * \param dirname parent directory * \param objname file name * \param fid object fid * \param feat index features required for directory create @@ -353,7 +353,7 @@ EXPORT_SYMBOL(llo_store_create_index); * Create md object for regular file in \a directory. * * \param md device - * \param dir parent directory + * \param dirname parent directory * \param objname file name * \param fid object fid. */ @@ -378,18 +378,18 @@ EXPORT_SYMBOL(llo_store_create); void llo_local_obj_register(struct lu_local_obj_desc *llod) { - mutex_lock(&llo_lock); - list_add_tail(&llod->llod_linkage, &llo_lobj_list); - mutex_unlock(&llo_lock); + cfs_mutex_lock(&llo_lock); + cfs_list_add_tail(&llod->llod_linkage, &llo_lobj_list); + cfs_mutex_unlock(&llo_lock); } EXPORT_SYMBOL(llo_local_obj_register); void llo_local_obj_unregister(struct lu_local_obj_desc *llod) { - mutex_lock(&llo_lock); - list_del(&llod->llod_linkage); - mutex_unlock(&llo_lock); + cfs_mutex_lock(&llo_lock); + cfs_list_del(&llod->llod_linkage); + cfs_mutex_unlock(&llo_lock); } EXPORT_SYMBOL(llo_local_obj_unregister); @@ -410,9 +410,9 @@ int llo_local_objects_setup(const struct lu_env *env, int rc = 0; fid = &info->lti_cfid; - mutex_lock(&llo_lock); + cfs_mutex_lock(&llo_lock); - list_for_each_entry(scan, &llo_lobj_list, llod_linkage) { + cfs_list_for_each_entry(scan, &llo_lobj_list, llod_linkage) { lu_local_obj_fid(fid, scan->llod_oid); dir = ""; if (scan->llod_dir) @@ -439,7 +439,7 @@ int llo_local_objects_setup(const struct lu_env *env, } out: - mutex_unlock(&llo_lock); + cfs_mutex_unlock(&llo_lock); return rc; } @@ -450,7 +450,7 @@ int llo_global_init(void) int result; CFS_INIT_LIST_HEAD(&llo_lobj_list); - mutex_init(&llo_lock); + cfs_mutex_init(&llo_lock); LU_CONTEXT_KEY_INIT(&llod_key); result = lu_context_key_register(&llod_key); @@ -460,5 +460,5 @@ int llo_global_init(void) void llo_global_fini(void) { lu_context_key_degister(&llod_key); - LASSERT(list_empty(&llo_lobj_list)); + LASSERT(cfs_list_empty(&llo_lobj_list)); }