6b13f685e
김민수
BSP 최초 추가
|
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
#ifndef _NILFS_SEGMENT_H
#define _NILFS_SEGMENT_H
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/nilfs2_fs.h>
#include "nilfs.h"
struct nilfs_root;
struct nilfs_recovery_info {
int ri_need_recovery;
sector_t ri_super_root;
__u64 ri_cno;
sector_t ri_lsegs_start;
sector_t ri_lsegs_end;
u64 ri_lsegs_start_seq;
struct list_head ri_used_segments;
sector_t ri_pseg_start;
u64 ri_seq;
__u64 ri_segnum;
__u64 ri_nextnum;
};
#define NILFS_RECOVERY_SR_UPDATED 1 /* The super root was updated */
#define NILFS_RECOVERY_ROLLFORWARD_DONE 2 /* Rollforward was carried out */
struct nilfs_cstage {
int scnt;
unsigned flags;
struct nilfs_inode_info *dirty_file_ptr;
struct nilfs_inode_info *gc_inode_ptr;
};
struct nilfs_segment_buffer;
struct nilfs_segsum_pointer {
struct buffer_head *bh;
unsigned offset;
};
struct nilfs_sc_info {
struct super_block *sc_super;
struct nilfs_root *sc_root;
unsigned long sc_nblk_inc;
struct list_head sc_dirty_files;
struct list_head sc_gc_inodes;
__u64 *sc_freesegs;
size_t sc_nfreesegs;
struct nilfs_inode_info *sc_dsync_inode;
loff_t sc_dsync_start;
loff_t sc_dsync_end;
struct list_head sc_segbufs;
struct list_head sc_write_logs;
unsigned long sc_segbuf_nblocks;
struct nilfs_segment_buffer *sc_curseg;
struct nilfs_cstage sc_stage;
struct nilfs_segsum_pointer sc_finfo_ptr;
struct nilfs_segsum_pointer sc_binfo_ptr;
unsigned long sc_blk_cnt;
unsigned long sc_datablk_cnt;
unsigned long sc_nblk_this_inc;
time_t sc_seg_ctime;
__u64 sc_cno;
unsigned long sc_flags;
spinlock_t sc_state_lock;
unsigned long sc_state;
unsigned long sc_flush_request;
wait_queue_head_t sc_wait_request;
wait_queue_head_t sc_wait_daemon;
wait_queue_head_t sc_wait_task;
__u32 sc_seq_request;
__u32 sc_seq_accepted;
__u32 sc_seq_done;
int sc_sync;
unsigned long sc_interval;
unsigned long sc_mjcp_freq;
unsigned long sc_lseg_stime;
unsigned long sc_watermark;
struct timer_list sc_timer;
struct task_struct *sc_task;
};
enum {
NILFS_SC_DIRTY,
NILFS_SC_UNCLOSED,
NILFS_SC_SUPER_ROOT,
NILFS_SC_PRIOR_FLUSH,
NILFS_SC_HAVE_DELTA,
};
#define NILFS_SEGCTOR_QUIT 0x0001 /* segctord is being destroyed */
#define NILFS_SEGCTOR_COMMIT 0x0004 /* committed transaction exists */
#define NILFS_SC_CLEANUP_RETRY 3 /* Retry count of construction when
destroying segctord */
#define NILFS_SC_DEFAULT_TIMEOUT 5 /* Timeout value of dirty blocks.
It triggers construction of a
logical segment with a super root */
#define NILFS_SC_DEFAULT_SR_FREQ 30 /* Maximum frequency of super root
creation */
#define NILFS_SC_DEFAULT_WATERMARK 3600
extern struct kmem_cache *nilfs_transaction_cachep;
extern void nilfs_relax_pressure_in_lock(struct super_block *);
extern int nilfs_construct_segment(struct super_block *);
extern int nilfs_construct_dsync_segment(struct super_block *, struct inode *,
loff_t, loff_t);
extern void nilfs_flush_segment(struct super_block *, ino_t);
extern int nilfs_clean_segments(struct super_block *, struct nilfs_argv *,
void **);
int nilfs_attach_log_writer(struct super_block *sb, struct nilfs_root *root);
void nilfs_detach_log_writer(struct super_block *sb);
extern int nilfs_read_super_root_block(struct the_nilfs *, sector_t,
struct buffer_head **, int);
extern int nilfs_search_super_root(struct the_nilfs *,
struct nilfs_recovery_info *);
int nilfs_salvage_orphan_logs(struct the_nilfs *nilfs, struct super_block *sb,
struct nilfs_recovery_info *ri);
extern void nilfs_dispose_segment_list(struct list_head *);
#endif /* _NILFS_SEGMENT_H */
|