Whamcloud - gitweb
LU-6635 lfsck: block replacing the OST-object for test
[fs/lustre-release.git] / lustre / fid / fid_internal.h
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
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.
9  *
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).
15  *
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.gnu.org/licenses/gpl-2.0.html
19  *
20  * GPL HEADER END
21  */
22 /*
23  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24  * Use is subject to license terms.
25  *
26  * Copyright (c) 2012, 2014, Intel Corporation.
27  */
28 /*
29  * This file is part of Lustre, http://www.lustre.org/
30  * Lustre is a trademark of Sun Microsystems, Inc.
31  *
32  * lustre/fid/fid_internal.h
33  *
34  * Author: Yury Umanets <umka@clusterfs.com>
35  */
36 #ifndef __FID_INTERNAL_H
37 #define __FID_INTERNAL_H
38
39 #include <lustre/lustre_idl.h>
40 #include <libcfs/libcfs.h>
41
42 #ifdef HAVE_SERVER_SUPPORT
43 # define HAVE_SEQ_SERVER
44
45 struct req_capsule;
46
47 struct seq_thread_info {
48         struct req_capsule     *sti_pill;
49         struct lu_seq_range     sti_space;
50         struct lu_buf           sti_buf;
51 };
52
53 enum {
54         SEQ_TXN_STORE_CREDITS = 20
55 };
56
57 extern struct lu_context_key seq_thread_key;
58
59 # ifdef CONFIG_PROC_FS
60 extern struct lprocfs_vars seq_server_proc_list[];
61 # endif
62
63 /* Store API functions. */
64 struct dt_device;
65
66 int seq_store_init(struct lu_server_seq *seq,
67                    const struct lu_env *env,
68                    struct dt_device *dt);
69
70 void seq_store_fini(struct lu_server_seq *seq,
71                     const struct lu_env *env);
72
73 int seq_store_read(struct lu_server_seq *seq,
74                    const struct lu_env *env);
75
76 int seq_store_update(const struct lu_env *env, struct lu_server_seq *seq,
77                      struct lu_seq_range *out, int sync);
78
79 int seq_server_alloc_spec(struct lu_server_seq *seq,
80                           struct lu_seq_range *spec,
81                           const struct lu_env *env);
82
83 int fid_server_mod_init(void);
84
85 void fid_server_mod_exit(void);
86
87 # endif /* HAVE_SERVER_SUPPORT */
88
89 /* Functions used internally in module. */
90 int seq_client_alloc_super(struct lu_client_seq *seq,
91                            const struct lu_env *env);
92
93 # ifdef CONFIG_PROC_FS
94 extern struct lprocfs_vars seq_client_proc_list[];
95 # endif
96
97 extern struct proc_dir_entry *seq_type_proc_dir;
98
99 #endif /* __FID_INTERNAL_H */