Whamcloud - gitweb
LU-5396 lod: (and mdt, mgs) make some symbols static
[fs/lustre-release.git] / lustre / lod / lod_dev.c
index fd51f33..3cb7171 100644 (file)
@@ -6,13 +6,13 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 only,
  * as published by the Free Software Foundation.
-
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License version 2 for more details.  A copy is
  * included in the COPYING file that accompanied this code.
-
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -23,8 +23,7 @@
  * Copyright  2009 Sun Microsystems, Inc. All rights reserved
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2013, Intel Corporation.
- *
+ * Copyright (c) 2012, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -119,15 +118,19 @@ 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;
 
-       LASSERTF(fid_is_sane(fid), "Invalid FID "DFID"\n", PFID(fid));
+       if (!fid_is_sane(fid)) {
+               CERROR("%s: invalid FID "DFID"\n", lod2obd(lod)->obd_name,
+                      PFID(fid));
+               RETURN(-EIO);
+       }
 
        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)))) {
@@ -135,27 +138,24 @@ 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;
-extern struct dt_object_operations lod_obj_ops;
-
 /* Slab for OSD object allocation */
 struct kmem_cache *lod_object_kmem;
 
@@ -180,9 +180,9 @@ static struct lu_device *lod_device_fini(const struct lu_env *env,
  *
  * see include/lu_object.h for the details.
  */
-struct lu_object *lod_object_alloc(const struct lu_env *env,
-                                  const struct lu_object_header *hdr,
-                                  struct lu_device *dev)
+static struct lu_object *lod_object_alloc(const struct lu_env *env,
+                                         const struct lu_object_header *hdr,
+                                         struct lu_device *dev)
 {
        struct lod_object       *lod_obj;
        struct lu_object        *lu_obj;