4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (c) 2011, 2013, Intel Corporation.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
45 #include "lustre/lustre_idl.h"
46 #include "../../include/linux/libcfs/libcfs.h"
53 extern const struct dt_index_features fld_index_features;
54 extern const char fld_index_name[];
57 * FLD (Fid Location Database) interface.
60 LUSTRE_CLI_FLD_HASH_DHT = 0,
61 LUSTRE_CLI_FLD_HASH_RRB
65 struct lu_fld_target {
66 struct list_head ft_chain;
67 struct obd_export *ft_exp;
68 struct lu_server_fld *ft_srv;
72 struct lu_server_fld {
74 * Fld dir proc entry. */
75 struct proc_dir_entry *lsf_proc_dir;
78 * /fld file object device */
79 struct dt_object *lsf_obj;
82 * super sequence controller export, needed to forward fld
84 struct obd_export *lsf_control_exp;
87 * Client FLD cache. */
88 struct fld_cache *lsf_cache;
91 * Protect index modifications */
92 struct mutex lsf_lock;
95 * Fld service name in form "fld-srv-lustre-MDTXXX" */
96 char lsf_name[LUSTRE_MDT_MAXNAMELEN];
100 struct lu_client_fld {
102 * Client side proc entry. */
103 struct proc_dir_entry *lcf_proc_dir;
106 * List of exports client FLD knows about. */
107 struct list_head lcf_targets;
110 * Current hash to be used to chose an export. */
111 struct lu_fld_hash *lcf_hash;
118 * Lock protecting exports list and fld_hash. */
122 * Client FLD cache. */
123 struct fld_cache *lcf_cache;
126 * Client fld proc entry name. */
127 char lcf_name[LUSTRE_MDT_MAXNAMELEN];
133 int fld_client_init(struct lu_client_fld *fld,
134 const char *prefix, int hash);
136 void fld_client_fini(struct lu_client_fld *fld);
138 void fld_client_flush(struct lu_client_fld *fld);
140 int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds,
141 __u32 flags, const struct lu_env *env);
143 int fld_client_create(struct lu_client_fld *fld,
144 struct lu_seq_range *range,
145 const struct lu_env *env);
147 int fld_client_delete(struct lu_client_fld *fld, u64 seq,
148 const struct lu_env *env);
150 int fld_client_add_target(struct lu_client_fld *fld,
151 struct lu_fld_target *tar);
153 int fld_client_del_target(struct lu_client_fld *fld,
156 void fld_client_proc_fini(struct lu_client_fld *fld);