* 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
* 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/
{
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)))) {
*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;