1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see [sun.com URL with a
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/fld/fld_internal.h
38 * Author: Yury Umanets <umka@clusterfs.com>
39 * Author: Tom WangDi <wangdi@clusterfs.com>
41 #ifndef __FLD_INTERNAL_H
42 #define __FLD_INTERNAL_H
44 #include <lustre/lustre_idl.h>
45 #include <dt_object.h>
47 #include <libcfs/libcfs.h>
49 #include <linux/types.h>
50 #include <lustre_req_layout.h>
51 #include <lustre_fld.h>
60 /* 4M of FLD cache will not hurt client a lot. */
61 FLD_SERVER_CACHE_SIZE = (4 * 0x100000),
63 /* 1M of FLD cache will not hurt client a lot. */
64 FLD_CLIENT_CACHE_SIZE = (1 * 0x100000)
68 /* Cache threshold is 10 percent of size. */
69 FLD_SERVER_CACHE_THRESHOLD = 10,
71 /* Cache threshold is 10 percent of size. */
72 FLD_CLIENT_CACHE_THRESHOLD = 10
77 * One page is used for hashtable. That is sizeof(struct hlist_head) *
80 FLD_CLIENT_HTABLE_SIZE = (1024 * 1),
83 * Here 4 pages are used for hashtable of server cache. This is is
84 * because cache it self is 4 times bugger.
86 FLD_SERVER_HTABLE_SIZE = (1024 * 4)
89 extern struct lu_fld_hash fld_hash[];
92 struct fld_thread_info {
93 struct req_capsule *fti_pill;
99 int fld_index_init(struct lu_server_fld *fld,
100 const struct lu_env *env,
101 struct dt_device *dt);
103 void fld_index_fini(struct lu_server_fld *fld,
104 const struct lu_env *env);
106 int fld_index_create(struct lu_server_fld *fld,
107 const struct lu_env *env,
108 seqno_t seq, mdsno_t mds);
110 int fld_index_delete(struct lu_server_fld *fld,
111 const struct lu_env *env,
114 int fld_index_lookup(struct lu_server_fld *fld,
115 const struct lu_env *env,
116 seqno_t seq, mdsno_t *mds);
119 extern struct lprocfs_vars fld_server_proc_list[];
120 extern struct lprocfs_vars fld_client_proc_list[];
125 static inline const char *
126 fld_target_name(struct lu_fld_target *tar)
128 if (tar->ft_srv != NULL)
129 return tar->ft_srv->lsf_name;
131 return (const char *)tar->ft_exp->exp_obd->obd_name;
134 extern cfs_proc_dir_entry_t *fld_type_proc_dir;
136 #endif /* __FLD_INTERNAL_H */