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.
30 * FLD (Fid Location Database) interface.
33 LUSTRE_CLI_FLD_HASH_DHT = 0,
34 LUSTRE_CLI_FLD_HASH_RRB,
35 LUSTRE_CLI_FLD_HASH_LAST
38 typedef int (*fld_hash_func_t) (struct lu_client_fld *, __u64);
42 fld_hash_func_t fh_func;
45 struct lu_server_fld {
46 struct proc_dir_entry *fld_proc_entry;
47 struct ptlrpc_service *fld_service;
48 struct dt_device *fld_dt;
49 struct dt_object *fld_obj;
50 struct lu_fid fld_fid; /* used during initialization */
51 struct dt_index_cookie *fld_cookie;
54 struct lu_client_fld {
55 struct proc_dir_entry *fld_proc_entry;
56 struct list_head fld_exports;
57 struct lu_fld_hash *fld_hash;
63 int fld_server_init(struct lu_server_fld *fld,
64 const struct lu_context *ctx,
65 struct dt_device *dt);
67 void fld_server_fini(struct lu_server_fld *fld,
68 const struct lu_context *ctx);
71 int fld_client_init(struct lu_client_fld *fld,
74 void fld_client_fini(struct lu_client_fld *fld);
76 int fld_client_add_export(struct lu_client_fld *fld,
77 struct obd_export *exp);
79 int fld_client_del_export(struct lu_client_fld *fld,
80 struct obd_export *exp);
82 int fld_client_create(struct lu_client_fld *fld,
83 __u64 seq, __u64 mds_num);
85 int fld_client_delete(struct lu_client_fld *fld,
86 __u64 seq, __u64 mds_num);
88 int fld_client_get(struct lu_client_fld *fld,
89 __u64 lu_seq, __u64 *mds_num);
91 int fld_client_lookup(struct lu_client_fld *fld,
92 __u64 lu_seq, __u64 *mds_num);