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
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
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 <lustre_req_layout.h>
50 #include <lustre_fld.h>
59 /* 4M of FLD cache will not hurt client a lot. */
60 FLD_SERVER_CACHE_SIZE = (4 * 0x100000),
62 /* 1M of FLD cache will not hurt client a lot. */
63 FLD_CLIENT_CACHE_SIZE = (1 * 0x100000)
67 /* Cache threshold is 10 percent of size. */
68 FLD_SERVER_CACHE_THRESHOLD = 10,
70 /* Cache threshold is 10 percent of size. */
71 FLD_CLIENT_CACHE_THRESHOLD = 10
76 * One page is used for hashtable. That is sizeof(struct hlist_head) *
79 FLD_CLIENT_HTABLE_SIZE = (1024 * 1),
82 * Here 4 pages are used for hashtable of server cache. This is is
83 * because cache it self is 4 times bugger.
85 FLD_SERVER_HTABLE_SIZE = (1024 * 4)
88 extern struct lu_fld_hash fld_hash[];
91 struct fld_thread_info {
92 struct req_capsule *fti_pill;
98 int fld_index_init(struct lu_server_fld *fld,
99 const struct lu_env *env,
100 struct dt_device *dt);
102 void fld_index_fini(struct lu_server_fld *fld,
103 const struct lu_env *env);
105 int fld_index_create(struct lu_server_fld *fld,
106 const struct lu_env *env,
107 seqno_t seq, mdsno_t mds);
109 int fld_index_delete(struct lu_server_fld *fld,
110 const struct lu_env *env,
113 int fld_index_lookup(struct lu_server_fld *fld,
114 const struct lu_env *env,
115 seqno_t seq, mdsno_t *mds);
118 extern struct lprocfs_vars fld_server_proc_list[];
119 extern struct lprocfs_vars fld_client_proc_list[];
124 static inline const char *
125 fld_target_name(struct lu_fld_target *tar)
127 if (tar->ft_srv != NULL)
128 return tar->ft_srv->lsf_name;
130 return (const char *)tar->ft_exp->exp_obd->obd_name;
133 extern cfs_proc_dir_entry_t *fld_type_proc_dir;
135 #endif /* __FLD_INTERNAL_H */