1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34#ifndef __LINUX_FLD_H
35#define __LINUX_FLD_H
36
37
38
39
40
41
42#include <uapi/linux/lustre/lustre_idl.h>
43#include <linux/libcfs/libcfs.h>
44#include <seq_range.h>
45
46struct lu_client_fld;
47struct lu_server_fld;
48struct lu_fld_hash;
49struct fld_cache;
50
51extern const struct dt_index_features fld_index_features;
52extern const char fld_index_name[];
53
54
55
56
57enum {
58 LUSTRE_CLI_FLD_HASH_DHT = 0,
59 LUSTRE_CLI_FLD_HASH_RRB
60};
61
62struct lu_fld_target {
63 struct list_head ft_chain;
64 struct obd_export *ft_exp;
65 struct lu_server_fld *ft_srv;
66 __u64 ft_idx;
67};
68
69struct lu_server_fld {
70
71
72
73
74 struct obd_export *lsf_control_exp;
75
76
77 struct fld_cache *lsf_cache;
78
79
80 struct mutex lsf_lock;
81
82
83 char lsf_name[LUSTRE_MDT_MAXNAMELEN];
84
85};
86
87struct lu_client_fld {
88
89 struct dentry *lcf_debugfs_entry;
90
91
92 struct list_head lcf_targets;
93
94
95 struct lu_fld_hash *lcf_hash;
96
97
98 int lcf_count;
99
100
101 spinlock_t lcf_lock;
102
103
104 struct fld_cache *lcf_cache;
105
106
107 char lcf_name[LUSTRE_MDT_MAXNAMELEN];
108};
109
110
111int fld_client_init(struct lu_client_fld *fld,
112 const char *prefix, int hash);
113
114void fld_client_fini(struct lu_client_fld *fld);
115
116void fld_client_flush(struct lu_client_fld *fld);
117
118int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds,
119 __u32 flags, const struct lu_env *env);
120
121int fld_client_create(struct lu_client_fld *fld,
122 struct lu_seq_range *range,
123 const struct lu_env *env);
124
125int fld_client_delete(struct lu_client_fld *fld, u64 seq,
126 const struct lu_env *env);
127
128int fld_client_add_target(struct lu_client_fld *fld,
129 struct lu_fld_target *tar);
130
131int fld_client_del_target(struct lu_client_fld *fld,
132 __u64 idx);
133
134void fld_client_debugfs_fini(struct lu_client_fld *fld);
135
136
137
138#endif
139