Whamcloud - gitweb
- some fixes after DLDINSP.
authoryury <yury>
Mon, 3 Jul 2006 16:19:31 +0000 (16:19 +0000)
committeryury <yury>
Mon, 3 Jul 2006 16:19:31 +0000 (16:19 +0000)
lustre/fld/fld_cache.c
lustre/fld/fld_handler.c
lustre/fld/fld_request.c
lustre/include/lustre_fld.h
lustre/mdt/mdt_handler.c

index 6d5105d..372fb92 100644 (file)
@@ -53,7 +53,8 @@
 #include "fld_internal.h"
 
 #ifdef __KERNEL__
-struct fld_cache_info *fld_cache_init(int size)
+struct fld_cache_info *
+fld_cache_init(int size)
 {
        struct fld_cache_info *cache;
         int i;
@@ -85,7 +86,8 @@ struct fld_cache_info *fld_cache_init(int size)
 }
 EXPORT_SYMBOL(fld_cache_init);
 
-void fld_cache_fini(struct fld_cache_info *cache)
+void
+fld_cache_fini(struct fld_cache_info *cache)
 {
         struct fld_cache_entry *flde;
         struct hlist_head *bucket;
index c809e68..e734802 100644 (file)
@@ -293,8 +293,8 @@ fld_server_proc_fini(struct lu_server_fld *fld)
 int
 fld_server_init(struct lu_server_fld *fld,
                 const struct lu_context *ctx,
-                const char *uuid,
-                struct dt_device *dt)
+                struct dt_device *dt,
+                const char *uuid)
 {
         int rc;
         struct ptlrpc_service_conf fld_conf = {
index 852b2a8..0b1f781 100644 (file)
@@ -93,9 +93,7 @@ fld_client_get_target(struct lu_client_fld *fld, seqno_t seq)
 
         spin_lock(&fld->fld_lock);
         hash = fld->fld_hash->fh_func(fld, seq);
-        spin_unlock(&fld->fld_lock);
 
-        spin_lock(&fld->fld_lock);
         list_for_each_entry(target,
                             &fld->fld_targets, fldt_chain) {
                 if (target->fldt_idx == hash) {
@@ -220,6 +218,11 @@ fld_client_proc_fini(struct lu_client_fld *fld)
 }
 #endif
 
+static inline int hash_is_sane(int hash)
+{
+        return (hash >= 0 && hash < LUSTRE_CLI_FLD_HASH_LAST);
+}
+
 int
 fld_client_init(struct lu_client_fld *fld,
                 const char *uuid, int hash)
@@ -229,7 +232,7 @@ fld_client_init(struct lu_client_fld *fld,
 
         LASSERT(fld != NULL);
 
-        if (hash < 0 || hash >= LUSTRE_CLI_FLD_HASH_LAST) {
+        if (!hash_is_sane(hash)) {
                 CERROR("wrong hash function 0x%x\n", hash);
                 RETURN(-EINVAL);
         }
index e505dc8..757b4a4 100644 (file)
@@ -104,8 +104,8 @@ struct lu_client_fld {
 /* server methods */
 int fld_server_init(struct lu_server_fld *fld,
                     const struct lu_context *ctx,
-                    const char *uuid,
-                    struct dt_device *dt);
+                    struct dt_device *dt,
+                    const char *uuid);
 
 void fld_server_fini(struct lu_server_fld *fld,
                      const struct lu_context *ctx);
index 2cd7c39..b9a9bab 100644 (file)
@@ -1855,7 +1855,7 @@ static int mdt_fld_init(const struct lu_context *ctx,
 
         if (ls->ls_server_fld != NULL) {
                 rc = fld_server_init(ls->ls_server_fld, ctx,
-                                     uuid, m->mdt_bottom);
+                                     m->mdt_bottom, uuid);
                 if (rc) {
                         OBD_FREE_PTR(ls->ls_server_fld);
                         ls->ls_server_fld = NULL;