From: Andreas Dilger Date: Fri, 14 Nov 2014 21:06:34 +0000 (-0700) Subject: LU-1445 lod: clean up lod_fld_lookup() return codes X-Git-Tag: 2.6.92~61 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8b40f512cced1329da8913aea8c957d9d896127b LU-1445 lod: clean up lod_fld_lookup() return codes 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 Change-Id: Ie4571226b3e90c866b958cf6ab65f6077abcab07 Reviewed-on: http://review.whamcloud.com/12727 Reviewed-by: John L. Hammond Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c index 42674ae..ea59aa2 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -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; - int rc = 0; + int rc; 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; - RETURN(rc); + RETURN(0); } 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; - 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); - if (rc) + if (rc != 0) 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;