Whamcloud - gitweb
LU-657 obdfilter: commit pending journals if -ENOSPC
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_iam.h
index 2c71983..98da250 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.
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2009, 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/
@@ -374,6 +374,8 @@ struct iam_leaf_operations {
         int (*key_cmp)(const struct iam_leaf *l, const struct iam_key *k);
         int (*key_eq)(const struct iam_leaf *l, const struct iam_key *k);
 
+       int (*rec_eq)(const struct iam_leaf *l, const struct iam_rec *r);
+
         int (*key_size)(const struct iam_leaf *l);
         /*
          * Search leaf @l for a record with key @k or for a place
@@ -447,15 +449,19 @@ struct iam_container {
          * Underlying flat file. IO against this object is issued to
          * read/write nodes.
          */
-        struct inode      *ic_object;
+        struct inode        *ic_object;
+        /*
+         * BH of root block
+         */
+        struct buffer_head  *ic_root_bh;
         /*
          * container flavor.
          */
-        struct iam_descr  *ic_descr;
+        struct iam_descr    *ic_descr;
         /*
          * read-write lock protecting index consistency.
          */
-        cfs_rw_semaphore_t ic_sem;
+        cfs_rw_semaphore_t   ic_sem;
 };
 
 /*
@@ -781,7 +787,7 @@ static inline unsigned dx_get_block(struct iam_path *p, struct iam_entry *entry)
         u32 *addr;
 
         addr = iam_entry_off(entry, iam_path_descr(p)->id_ikey_size);
-        return le32_to_cpu(get_unaligned(addr)) & 0x00ffffff;
+        return le32_to_cpu(get_unaligned(addr));
 }
 
 static inline void dx_set_block(struct iam_path *p,
@@ -993,7 +999,7 @@ int iam_lvar_create(struct inode *obj,
 #endif
 
 #define BH_DXLock        25
-#define DX_DEBUG (1)
+#define DX_DEBUG (0)
 #if DX_DEBUG
 static struct iam_lock_stats {
         unsigned dls_bh_lock;