Whamcloud - gitweb
LU-8080 utils: Replace calls to signal with sigaction
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_iam.h
index fdb80e1..40c528b 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 
 #include <linux/module.h>
 #include <asm/unaligned.h>
-#include <linux/dynlocks.h>
+
+#include "osd_dynlocks.h"
 /*
- *  linux/include/linux/osd_iam.h
+ *  osd_iam.h
  */
 #ifndef CLASSERT
 #define CLASSERT(cond) do {switch(42) {case (cond): case 0: break;}} while (0)
@@ -91,7 +92,6 @@ enum {
         DX_FMT_NAME_LEN    = 16,
 };
 
-#ifdef __KERNEL__
 
 /*
  * Debugging.
@@ -484,10 +484,8 @@ struct iam_container {
          */
        struct rw_semaphore     ic_sem;
        struct dynlock       ic_tree_lock;
-       /*
-        * Protect ic_idle_bh
-        */
-       struct semaphore        ic_idle_sem;
+       /* Protect ic_idle_bh */
+       struct mutex         ic_idle_mutex;
        /*
         * BH for idle blocks
         */
@@ -937,7 +935,7 @@ static inline struct iam_entry *dx_node_get_entries(struct iam_path *path,
 static inline struct iam_ikey *iam_path_ikey(const struct iam_path *path,
                                              int nr)
 {
-        assert(0 <= nr && nr < ARRAY_SIZE(path->ip_data->ipd_key_scratch));
+       LASSERT(0 <= nr && nr < ARRAY_SIZE(path->ip_data->ipd_key_scratch));
         return path->ip_data->ipd_key_scratch[nr];
 }
 
@@ -974,8 +972,6 @@ int dx_index_is_compat(struct iam_path *path);
 int ldiskfs_htree_next_block(struct inode *dir, __u32 hash,
                           struct iam_path *path, __u32 *start_hash);
 
-struct buffer_head *ldiskfs_append(handle_t *handle, struct inode *inode,
-                                u32 *block, int *err);
 int split_index_node(handle_t *handle, struct iam_path *path,
                      struct dynlock_handle **lh);
 struct ldiskfs_dir_entry_2 *split_entry(struct inode *dir,
@@ -1024,7 +1020,7 @@ int iam_lvar_create(struct inode *obj,
 #define dxtrace(command) 
 #endif
 
-#define BH_DXLock        25
+#define BH_DXLock        (BH_BITMAP_UPTODATE + 1)
 #define DX_DEBUG (0)
 #if DX_DEBUG
 static struct iam_lock_stats {
@@ -1097,7 +1093,7 @@ struct iam_format {
         /*
          * Linkage into global list of container formats.
          */
-        cfs_list_t if_linkage;
+       struct list_head if_linkage;
 };
 
 void iam_format_register(struct iam_format *fmt);
@@ -1134,7 +1130,6 @@ static inline int ldiskfs_check_dir_entry(const char * function,
 */
 
 /* __KERNEL__ */
-#endif
 
 /*
  * User level API. Copy exists in lustre/lustre/tests/iam_ut.c