Whamcloud - gitweb
LU-1302 llog: pass lu_env as parametr in llog functions
[fs/lustre-release.git] / lustre / obdclass / cl_object.c
index 9e65b3a..5ab8a92 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) 2011, 2012, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -50,9 +50,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
 
 #include <libcfs/libcfs.h>
 /* class_put_type() */
@@ -76,8 +73,8 @@ static cfs_lock_class_key_t cl_lock_guard_class;
 /** Lock class of cl_object_header::coh_attr_guard */
 static cfs_lock_class_key_t cl_attr_guard_class;
 
-static __u32 cl_ctx_tags;
-static __u32 cl_ses_tags;
+extern __u32 lu_context_tags_default;
+extern __u32 lu_session_tags_default;
 /**
  * Initialize cl_object_header.
  */
@@ -543,7 +540,7 @@ static CFS_LIST_HEAD(cl_envs);
 static unsigned cl_envs_cached_nr  = 0;
 static unsigned cl_envs_cached_max = 128; /* XXX: prototype: arbitrary limit
                                            * for now. */
-static cfs_spinlock_t cl_envs_guard = CFS_SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cl_envs_guard);
 
 struct cl_env {
         void             *ce_magic;
@@ -795,18 +792,6 @@ static void cl_env_fini(struct cl_env *cle)
         OBD_SLAB_FREE_PTR(cle, cl_env_kmem);
 }
 
-void cl_set_ctx_tags(__u32 tags)
-{
-        cl_ctx_tags = tags;
-}
-EXPORT_SYMBOL(cl_set_ctx_tags);
-
-void cl_set_ses_tags(__u32 tags)
-{
-        cl_ses_tags = tags;
-}
-EXPORT_SYMBOL(cl_set_ses_tags);
-
 static struct lu_env *cl_env_obtain(void *debug)
 {
         struct cl_env *cle;
@@ -835,7 +820,8 @@ static struct lu_env *cl_env_obtain(void *debug)
                 }
         } else {
                 cfs_spin_unlock(&cl_envs_guard);
-                env = cl_env_new(cl_ctx_tags, cl_ses_tags, debug);
+                env = cl_env_new(lu_context_tags_default,
+                                 lu_session_tags_default, debug);
         }
         RETURN(env);
 }