Whamcloud - gitweb
LU-1484 kernel: fix build error with 2.6.18 kernel
[fs/lustre-release.git] / libcfs / include / libcfs / params_tree.h
index 635d6bc..fac664e 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.
 #ifndef __PARAMS_TREE_H__
 #define __PARAMS_TREE_H__
 
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
 #include <libcfs/libcfs.h>
 
 #undef LPROCFS
@@ -80,7 +74,7 @@ typedef struct poll_table_struct                cfs_poll_table_t;
 #define cfs_seq_open(file, ops, rc)             (rc = seq_open(file, ops))
 
 /* in lprocfs_stat.c, to protect the private data for proc entries */
-extern cfs_rw_semaphore_t       _lprocfs_lock;
+extern struct rw_semaphore             _lprocfs_lock;
 
 /* to begin from 2.6.23, Linux defines self file_operations (proc_reg_file_ops)
  * in procfs, the proc file_operation defined by Lustre (lprocfs_generic_fops)
@@ -92,14 +86,14 @@ extern cfs_rw_semaphore_t       _lprocfs_lock;
  */
 #ifndef HAVE_PROCFS_USERS
 
-#define LPROCFS_ENTRY()                 \
-do {                                    \
-        cfs_down_read(&_lprocfs_lock);  \
+#define LPROCFS_ENTRY()                \
+do {                                   \
+       down_read(&_lprocfs_lock);      \
 } while(0)
 
-#define LPROCFS_EXIT()                  \
-do {                                    \
-        cfs_up_read(&_lprocfs_lock);    \
+#define LPROCFS_EXIT()                 \
+do {                                   \
+       up_read(&_lprocfs_lock);        \
 } while(0)
 
 #else
@@ -109,10 +103,6 @@ do {                                    \
 
 #ifdef HAVE_PROCFS_DELETED
 
-#ifdef HAVE_PROCFS_USERS
-#error proc_dir_entry->deleted is conflicted with proc_dir_entry->pde_users
-#endif
-
 static inline
 int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
 {
@@ -127,14 +117,15 @@ int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
 static inline
 int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
 {
-        int deleted = 0;
-        spin_lock(&(dp)->pde_unload_lock);
-        if (dp->proc_fops == NULL)
-                deleted = 1;
-        spin_unlock(&(dp)->pde_unload_lock);
-        if (deleted)
-                return -ENODEV;
-        return 0;
+       int deleted = 0;
+
+       spin_lock(&(dp)->pde_unload_lock);
+       if (dp->proc_fops == NULL)
+               deleted = 1;
+       spin_unlock(&(dp)->pde_unload_lock);
+       if (deleted)
+               return -ENODEV;
+       return 0;
 }
 #else /* !HAVE_PROCFS_DELETED*/
 static inline
@@ -154,14 +145,14 @@ do {                                    \
         up_read(&_lprocfs_lock);        \
 } while(0)
 
-#define LPROCFS_WRITE_ENTRY()           \
-do {                                    \
-        cfs_down_write(&_lprocfs_lock); \
+#define LPROCFS_WRITE_ENTRY()          \
+do {                                   \
+       down_write(&_lprocfs_lock);     \
 } while(0)
 
-#define LPROCFS_WRITE_EXIT()            \
-do {                                    \
-        cfs_up_write(&_lprocfs_lock);   \
+#define LPROCFS_WRITE_EXIT()           \
+do {                                   \
+       up_write(&_lprocfs_lock);       \
 } while(0)
 #else /* !LPROCFS */
 
@@ -192,7 +183,7 @@ typedef struct cfs_seq_file {
         size_t                     count;
         loff_t                     index;
         loff_t                     version;
-        cfs_mutex_t                lock;
+       struct mutex                    lock;
         struct cfs_seq_operations *op;
         void                      *private;
 } cfs_seq_file_t;