summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/lpt_commit.c
blob: 2764a418fab526faad0eda9b78c57eb8b856c75f (plain)
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
/*
 * This file is part of UBIFS.
 *
 * Copyright (C) 2006-2008 Nokia Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 51
 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * Authors: Adrian Hunter
 *          Artem Bityutskiy (Битюцкий Артём)
 */

/*
 * This file implements commit-related functionality of the LEB properties
 * subsystem.
 */

#include <linux/err.h>
#include "ubifs.h"

/*
 * removed in barebox
static struct ubifs_cnode *first_dirty_cnode(const struct ubifs_info *c, struct ubifs_nnode *nnode)
 */

/*
 * removed in barebox
static struct ubifs_cnode *next_dirty_cnode(const struct ubifs_info *c, struct ubifs_cnode *cnode)
 */

/*
 * removed in barebox
static int get_cnodes_to_commit(struct ubifs_info *c)
 */

/*
 * removed in barebox
static void upd_ltab(struct ubifs_info *c, int lnum, int free, int dirty)
 */

/*
 * removed in barebox
static int alloc_lpt_leb(struct ubifs_info *c, int *lnum)
 */

/*
 * removed in barebox
static int layout_cnodes(struct ubifs_info *c)
 */

/*
 * removed in barebox
static int realloc_lpt_leb(struct ubifs_info *c, int *lnum)
 */

/*
 * removed in barebox
static int write_cnodes(struct ubifs_info *c)
 */

/*
 * removed in barebox
static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c,
					       struct ubifs_pnode *pnode)
 */

/*
 * removed in barebox
static struct ubifs_pnode *pnode_lookup(struct ubifs_info *c, int i)
 */

/*
 * removed in barebox
static void add_pnode_dirt(struct ubifs_info *c, struct ubifs_pnode *pnode)
 */

/*
 * removed in barebox
static void do_make_pnode_dirty(struct ubifs_info *c, struct ubifs_pnode *pnode)
 */

/*
 * removed in barebox
static int make_tree_dirty(struct ubifs_info *c)
 */

/*
 * removed in barebox
static int need_write_all(struct ubifs_info *c)
 */

/*
 * removed in barebox
static void lpt_tgc_start(struct ubifs_info *c)
 */

/*
 * removed in barebox
static int lpt_tgc_end(struct ubifs_info *c)
 */

/*
 * removed in barebox
static void populate_lsave(struct ubifs_info *c)
 */

/*
 * removed in barebox
static struct ubifs_nnode *nnode_lookup(struct ubifs_info *c, int i)
 */

/*
 * removed in barebox
static int make_nnode_dirty(struct ubifs_info *c, int node_num, int lnum,
			    int offs)
 */

/*
 * removed in barebox
static int make_pnode_dirty(struct ubifs_info *c, int node_num, int lnum,
			    int offs)
 */

/*
 * removed in barebox
static int make_ltab_dirty(struct ubifs_info *c, int lnum, int offs)
 */

/*
 * removed in barebox
static int make_lsave_dirty(struct ubifs_info *c, int lnum, int offs)
 */

/*
 * removed in barebox
static int make_node_dirty(struct ubifs_info *c, int node_type, int node_num,
			   int lnum, int offs)
 */

/*
 * removed in barebox
static int get_lpt_node_len(const struct ubifs_info *c, int node_type)
 */

/*
 * removed in barebox
static int get_pad_len(const struct ubifs_info *c, uint8_t *buf, int len)
 */

/*
 * removed in barebox
static int get_lpt_node_type(const struct ubifs_info *c, uint8_t *buf,
			     int *node_num)
 */

/*
 * removed in barebox
static int is_a_node(const struct ubifs_info *c, uint8_t *buf, int len)
 */

/*
 * removed in barebox
static int lpt_gc_lnum(struct ubifs_info *c, int lnum)
 */

/*
 * removed in barebox
static int lpt_gc(struct ubifs_info *c)
 */

/*
 * removed in barebox
int ubifs_lpt_start_commit(struct ubifs_info *c)
 */

/*
 * removed in barebox
static void free_obsolete_cnodes(struct ubifs_info *c)
 */

/*
 * removed in barebox
int ubifs_lpt_end_commit(struct ubifs_info *c)
 */

/*
 * removed in barebox
int ubifs_lpt_post_commit(struct ubifs_info *c)
 */

/*
 * removed in barebox
static struct ubifs_nnode *first_nnode(struct ubifs_info *c, int *hght)
 */

/*
 * removed in barebox
static struct ubifs_nnode *next_nnode(struct ubifs_info *c,
				      struct ubifs_nnode *nnode, int *hght)
 */

/*
 * removed in barebox
void ubifs_lpt_free(struct ubifs_info *c, int wr_only)
 */

/*
 * Everything below is related to debugging.
 */

/*
 * removed in barebox
static int dbg_is_all_ff(uint8_t *buf, int len)
 */

/*
 * removed in barebox
static int dbg_is_nnode_dirty(struct ubifs_info *c, int lnum, int offs)
 */

/*
 * removed in barebox
static int dbg_is_pnode_dirty(struct ubifs_info *c, int lnum, int offs)
 */

/*
 * removed in barebox
static int dbg_is_ltab_dirty(struct ubifs_info *c, int lnum, int offs)
 */

/*
 * removed in barebox
static int dbg_is_lsave_dirty(struct ubifs_info *c, int lnum, int offs)
 */

/*
 * removed in barebox
static int dbg_is_node_dirty(struct ubifs_info *c, int node_type, int lnum,
			     int offs)
*/

/*
 * removed in barebox
static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum)
 */

/*
 * removed in barebox
int dbg_check_ltab(struct ubifs_info *c)
 */

/*
 * removed in barebox
int dbg_chk_lpt_free_spc(struct ubifs_info *c)
 */

/*
 * removed in barebox
int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len)
 */

/*
 * removed in barebox
static void dump_lpt_leb(const struct ubifs_info *c, int lnum)
 */

/*
 * removed in barebox
void ubifs_dump_lpt_lebs(const struct ubifs_info *c)
 */

/*
 * removed in barebox
static int dbg_populate_lsave(struct ubifs_info *c)
 */