Whamcloud - gitweb
LU-1445 lod: clean up lod_fld_lookup() return codes 27/12727/2
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 14 Nov 2014 21:06:34 +0000 (14:06 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 10 Dec 2014 23:37:01 +0000 (23:37 +0000)
Don't return "rc" when it is known that this will always be "0".
This confuses the reader into thinking that this is an error path
when it is in fact a no-op shortcut that returns success.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Ie4571226b3e90c866b958cf6ab65f6077abcab07
Reviewed-on: http://review.whamcloud.com/12727
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_dev.c

index 42674ae..ea59aa2 100644 (file)
@@ -119,7 +119,7 @@ int lod_fld_lookup(const struct lu_env *env, struct lod_device *lod,
 {
        struct lu_seq_range     range = { 0 };
        struct lu_server_fld    *server_fld;
 {
        struct lu_seq_range     range = { 0 };
        struct lu_server_fld    *server_fld;
-       int rc = 0;
+       int rc;
        ENTRY;
 
        if (!fid_is_sane(fid)) {
        ENTRY;
 
        if (!fid_is_sane(fid)) {
@@ -131,7 +131,7 @@ int lod_fld_lookup(const struct lu_env *env, struct lod_device *lod,
        if (fid_is_idif(fid)) {
                *tgt = fid_idif_ost_idx(fid);
                *type = LU_SEQ_RANGE_OST;
        if (fid_is_idif(fid)) {
                *tgt = fid_idif_ost_idx(fid);
                *type = LU_SEQ_RANGE_OST;
-               RETURN(rc);
+               RETURN(0);
        }
 
        if (!lod->lod_initialized || (!fid_seq_in_fldb(fid_seq(fid)))) {
        }
 
        if (!lod->lod_initialized || (!fid_seq_in_fldb(fid_seq(fid)))) {
@@ -139,22 +139,22 @@ int lod_fld_lookup(const struct lu_env *env, struct lod_device *lod,
 
                *tgt = lu_site2seq(lod2lu_dev(lod)->ld_site)->ss_node_id;
                *type = LU_SEQ_RANGE_MDT;
 
                *tgt = lu_site2seq(lod2lu_dev(lod)->ld_site)->ss_node_id;
                *type = LU_SEQ_RANGE_MDT;
-               RETURN(rc);
+               RETURN(0);
        }
 
        server_fld = lu_site2seq(lod2lu_dev(lod)->ld_site)->ss_server_fld;
        fld_range_set_type(&range, *type);
        rc = fld_server_lookup(env, server_fld, fid_seq(fid), &range);
        }
 
        server_fld = lu_site2seq(lod2lu_dev(lod)->ld_site)->ss_server_fld;
        fld_range_set_type(&range, *type);
        rc = fld_server_lookup(env, server_fld, fid_seq(fid), &range);
-       if (rc)
+       if (rc != 0)
                RETURN(rc);
 
        *tgt = range.lsr_index;
        *type = range.lsr_flags;
 
                RETURN(rc);
 
        *tgt = range.lsr_index;
        *type = range.lsr_flags;
 
-       CDEBUG(D_INFO, "LOD: got tgt %x for sequence: "
-              LPX64"\n", *tgt, fid_seq(fid));
+       CDEBUG(D_INFO, "%s: got tgt %x for sequence: "LPX64"\n",
+              lod2obd(lod)->obd_name, *tgt, fid_seq(fid));
 
 
-       RETURN(rc);
+       RETURN(0);
 }
 
 extern struct lu_object_operations lod_lu_obj_ops;
 }
 
 extern struct lu_object_operations lod_lu_obj_ops;