/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * * Copyright (C) 2006 Cluster File Systems, Inc. * * This file is part of Lustre, http://www.lustre.org. * * Lustre is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * Lustre 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 for more details. * * You should have received a copy of the GNU General Public License * along with Lustre; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef EXPORT_SYMTAB # define EXPORT_SYMTAB #endif #define DEBUG_SUBSYSTEM S_LMV #ifdef __KERNEL__ #include #include #include #include #include #include #include #else #include #endif #include #include #include #include #include #include #include #include #include "lmv_internal.h" int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, mdsno_t *mds) { int rc; ENTRY; LASSERT(fid_is_sane(fid)); rc = fld_client_lookup(&lmv->lmv_fld, fid_seq(fid), mds, NULL); if (rc) { CERROR("Error while looking for mds number. Seq "LPU64 ", err = %d\n", fid_seq(fid), rc); RETURN(rc); } CDEBUG(D_INFO, "Got mds "LPU64" for sequence: "LPU64"\n", *mds, fid_seq(fid)); if (*mds >= lmv->desc.ld_tgt_count) { CERROR("Got invalid mds: "LPU64" (max: %d)\n", *mds, lmv->desc.ld_tgt_count); rc = -EINVAL; } RETURN(rc); }