Whamcloud - gitweb
LU-1934 echo: echo client to work over OFD
[fs/lustre-release.git] / lustre / lov / lov_pool.c
index b4b93dc..4c88202 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.
@@ -53,6 +51,9 @@
 #include <obd.h>
 #include "lov_internal.h"
 
+#define pool_tgt(_p, _i) \
+               _p->pool_lobd->u.lov.lov_tgts[_p->pool_obds.op_array[_i]]
+
 static void lov_pool_getref(struct pool_desc *pool)
 {
         CDEBUG(D_INFO, "pool %p\n", pool);
@@ -88,7 +89,7 @@ void lov_pool_putref_locked(struct pool_desc *pool)
  * Chapter 6.4.
  * Addison Wesley, 1973
  */
-static __u32 pool_hashfn(cfs_hash_t *hash_body, void *key, unsigned mask)
+static __u32 pool_hashfn(cfs_hash_t *hash_body, const void *key, unsigned mask)
 {
         int i;
         __u32 result;
@@ -112,7 +113,7 @@ static void *pool_key(cfs_hlist_node_t *hnode)
         return (pool->pool_name);
 }
 
-static int pool_hashkey_keycmp(void *key, cfs_hlist_node_t *compared_hnode)
+static int pool_hashkey_keycmp(const void *key, cfs_hlist_node_t *compared_hnode)
 {
         char *pool_name;
         struct pool_desc *pool;
@@ -127,22 +128,21 @@ static void *pool_hashobject(cfs_hlist_node_t *hnode)
         return cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
 }
 
-static void *pool_hashrefcount_get(cfs_hlist_node_t *hnode)
+static void pool_hashrefcount_get(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
 {
         struct pool_desc *pool;
 
         pool = cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
         lov_pool_getref(pool);
-        return (pool);
 }
 
-static void *pool_hashrefcount_put_locked(cfs_hlist_node_t *hnode)
+static void pool_hashrefcount_put_locked(cfs_hash_t *hs,
+                                         cfs_hlist_node_t *hnode)
 {
         struct pool_desc *pool;
 
         pool = cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
         lov_pool_putref_locked(pool);
-        return (pool);
 }
 
 cfs_hash_ops_t pool_hash_operations = {
@@ -449,7 +449,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
 
         strncpy(new_pool->pool_name, poolname, LOV_MAXPOOLNAME);
         new_pool->pool_name[LOV_MAXPOOLNAME] = '\0';
-        new_pool->pool_lov = lov;
+       new_pool->pool_lobd = obd;
         /* ref count init to 1 because when created a pool is always used
          * up to deletion
          */