1 /* -*- MODE: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * Copyright (C) 2006 Cluster File Systems, Inc.
7 * Author: Yury Umanets <umka@clusterfs.com>
8 * Tom WangDi <wangdi@clusterfs.com>
10 * This file is part of the Lustre file system, http://www.lustre.org
11 * Lustre is a trademark of Cluster File Systems, Inc.
13 * You may have signed or agreed to another license before downloading
14 * this software. If so, you are bound by the terms and conditions
15 * of that agreement, and the following does not apply to you. See the
16 * LICENSE file included with this distribution for more information.
18 * If you did not agree to a different license, then this copy of Lustre
19 * is open source software; you can redistribute it and/or modify it
20 * under the terms of version 2 of the GNU General Public License as
21 * published by the Free Software Foundation.
23 * In either case, Lustre is distributed in the hope that it will be
24 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
25 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * license text for more details.
28 #ifndef __FLD_INTERNAL_H
29 #define __FLD_INTERNAL_H
31 #include <lustre/lustre_idl.h>
32 #include <dt_object.h>
34 #include <libcfs/libcfs.h>
36 #include <linux/types.h>
37 #include <lustre_req_layout.h>
38 #include <lustre_fld.h>
47 /* 4M of FLD cache will not hurt client a lot. */
48 FLD_SERVER_CACHE_SIZE = (4 * 0x100000),
50 /* 1M of FLD cache will not hurt client a lot. */
51 FLD_CLIENT_CACHE_SIZE = (1 * 0x100000)
55 /* Cache threshold is 10 percent of size. */
56 FLD_SERVER_CACHE_THRESHOLD = 10,
58 /* Cache threshold is 10 percent of size. */
59 FLD_CLIENT_CACHE_THRESHOLD = 10
64 * One page is used for hashtable. That is sizeof(struct hlist_head) *
67 FLD_CLIENT_HTABLE_SIZE = (1024 * 1),
70 * Here 4 pages are used for hashtable of server cache. This is is
71 * because cache it self is 4 times bugger.
73 FLD_SERVER_HTABLE_SIZE = (1024 * 4)
76 extern struct lu_fld_hash fld_hash[];
79 struct fld_thread_info {
80 struct req_capsule *fti_pill;
86 int fld_index_init(struct lu_server_fld *fld,
87 const struct lu_env *env,
88 struct dt_device *dt);
90 void fld_index_fini(struct lu_server_fld *fld,
91 const struct lu_env *env);
93 int fld_index_create(struct lu_server_fld *fld,
94 const struct lu_env *env,
95 seqno_t seq, mdsno_t mds);
97 int fld_index_delete(struct lu_server_fld *fld,
98 const struct lu_env *env,
101 int fld_index_lookup(struct lu_server_fld *fld,
102 const struct lu_env *env,
103 seqno_t seq, mdsno_t *mds);
106 extern struct lprocfs_vars fld_server_proc_list[];
107 extern struct lprocfs_vars fld_client_proc_list[];
112 static inline const char *
113 fld_target_name(struct lu_fld_target *tar)
115 if (tar->ft_srv != NULL)
116 return tar->ft_srv->lsf_name;
118 return (const char *)tar->ft_exp->exp_obd->obd_name;
121 extern cfs_proc_dir_entry_t *fld_type_proc_dir;
123 #endif /* __FLD_INTERNAL_H */