1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2006 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 # define EXPORT_SYMTAB
25 #define DEBUG_SUBSYSTEM S_LMV
27 #include <linux/slab.h>
28 #include <linux/module.h>
29 #include <linux/init.h>
30 #include <linux/slab.h>
31 #include <linux/pagemap.h>
32 #include <asm/div64.h>
33 #include <linux/seq_file.h>
35 #include <liblustre.h>
38 #include <lustre/lustre_idl.h>
39 #include <obd_support.h>
40 #include <lustre_fid.h>
41 #include <lustre_lib.h>
42 #include <lustre_net.h>
43 #include <lustre_dlm.h>
44 #include <obd_class.h>
45 #include <lprocfs_status.h>
46 #include "lmv_internal.h"
48 int lmv_fld_lookup(struct lmv_obd *lmv,
49 const struct lu_fid *fid,
55 LASSERT(fid_is_sane(fid));
56 rc = fld_client_lookup(&lmv->lmv_fld, fid_seq(fid), mds, NULL);
58 CERROR("Error while looking for mds number. Seq "LPU64
59 ", err = %d\n", fid_seq(fid), rc);
63 CDEBUG(D_INFO, "Got mds "LPU64" for sequence: "LPU64"\n",
66 if (*mds >= lmv->desc.ld_tgt_count) {
67 CERROR("Got invalid mds: "LPU64" (max: %d)\n",
68 *mds, lmv->desc.ld_tgt_count);