Whamcloud - gitweb
LU-3281 osc: some cleanup to reduce stack overflow chance
[fs/lustre-release.git] / lustre / obdclass / md_local_object.c
index 1d459a7..7f235f4 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +26,8 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -43,9 +43,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
 
 #include <obd_support.h>
 #include <lustre_disk.h>
@@ -59,7 +56,7 @@
 static cfs_list_t llo_lobj_list;
 
 /** Lock to protect list manipulations */
-static cfs_mutex_t     llo_lock;
+static struct mutex    llo_lock;
 
 /**
  * Structure used to maintain state of path parsing.
@@ -91,7 +88,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
 };
@@ -137,7 +134,6 @@ static int llo_lookup(const struct lu_env  *env,
         spec->sp_cr_flags = 0;
         spec->sp_cr_lookup = 0;
         spec->sp_cr_mode = 0;
-        spec->sp_ck_split = 0;
 
         lname->ln_name = name;
         lname->ln_namelen = strlen(name);
@@ -289,7 +285,6 @@ static struct md_object *llo_create_obj(const struct lu_env *env,
         spec->sp_cr_flags = 0;
         spec->sp_cr_lookup = 1;
         spec->sp_cr_mode = 0;
-        spec->sp_ck_split = 0;
 
         if (feat == &dt_directory_features)
                 la->la_mode = S_IFDIR | S_IXUGO;
@@ -378,18 +373,18 @@ EXPORT_SYMBOL(llo_store_create);
 
 void llo_local_obj_register(struct lu_local_obj_desc *llod)
 {
-        cfs_mutex_lock(&llo_lock);
+       mutex_lock(&llo_lock);
         cfs_list_add_tail(&llod->llod_linkage, &llo_lobj_list);
-        cfs_mutex_unlock(&llo_lock);
+       mutex_unlock(&llo_lock);
 }
 
 EXPORT_SYMBOL(llo_local_obj_register);
 
 void llo_local_obj_unregister(struct lu_local_obj_desc *llod)
 {
-        cfs_mutex_lock(&llo_lock);
+       mutex_lock(&llo_lock);
         cfs_list_del(&llod->llod_linkage);
-        cfs_mutex_unlock(&llo_lock);
+       mutex_unlock(&llo_lock);
 }
 
 EXPORT_SYMBOL(llo_local_obj_unregister);
@@ -410,7 +405,7 @@ int llo_local_objects_setup(const struct lu_env *env,
         int rc = 0;
 
         fid = &info->lti_cfid;
-        cfs_mutex_lock(&llo_lock);
+       mutex_lock(&llo_lock);
 
         cfs_list_for_each_entry(scan, &llo_lobj_list, llod_linkage) {
                 lu_local_obj_fid(fid, scan->llod_oid);
@@ -439,7 +434,7 @@ int llo_local_objects_setup(const struct lu_env *env,
         }
 
 out:
-        cfs_mutex_unlock(&llo_lock);
+       mutex_unlock(&llo_lock);
         return rc;
 }
 
@@ -450,7 +445,7 @@ int llo_global_init(void)
         int result;
 
         CFS_INIT_LIST_HEAD(&llo_lobj_list);
-        cfs_mutex_init(&llo_lock);
+       mutex_init(&llo_lock);
 
         LU_CONTEXT_KEY_INIT(&llod_key);
         result = lu_context_key_register(&llod_key);