]>
Commit | Line | Data |
---|---|---|
6a930a95 BS |
1 | From: Jeff Mahoney <jeffm@suse.com> |
2 | Subject: reiserfs: rename p_s_sb to sb | |
3 | ||
4 | This patch is a simple s/p_s_sb/sb/g to the reiserfs code. This is the first | |
5 | in a series of patches to rip out some of the awful variable naming in | |
6 | reiserfs. | |
7 | ||
8 | Signed-off-by: Jeff Mahoney <jeffm@suse.com> | |
9 | ||
10 | --- | |
11 | ||
12 | fs/reiserfs/fix_node.c | 46 +- | |
13 | fs/reiserfs/fix_node.c | 46 +- | |
14 | fs/reiserfs/journal.c | 735 ++++++++++++++++++++---------------------- | |
15 | fs/reiserfs/stree.c | 126 +++---- | |
16 | fs/reiserfs/tail_conversion.c | 16 | |
17 | include/linux/reiserfs_fs.h | 14 | |
18 | 5 files changed, 468 insertions(+), 469 deletions(-) | |
19 | ||
20 | --- a/fs/reiserfs/fix_node.c | |
21 | +++ b/fs/reiserfs/fix_node.c | |
22 | @@ -785,7 +785,7 @@ static int get_empty_nodes(struct tree_b | |
23 | b_blocknr_t *p_n_blocknr, a_n_blocknrs[MAX_AMOUNT_NEEDED] = { 0, }; | |
24 | int n_counter, n_number_of_freeblk, n_amount_needed, /* number of needed empty blocks */ | |
25 | n_retval = CARRY_ON; | |
26 | - struct super_block *p_s_sb = p_s_tb->tb_sb; | |
27 | + struct super_block *sb = p_s_tb->tb_sb; | |
28 | ||
29 | /* number_of_freeblk is the number of empty blocks which have been | |
30 | acquired for use by the balancing algorithm minus the number of | |
31 | @@ -830,7 +830,7 @@ static int get_empty_nodes(struct tree_b | |
32 | RFALSE(!*p_n_blocknr, | |
33 | "PAP-8135: reiserfs_new_blocknrs failed when got new blocks"); | |
34 | ||
35 | - p_s_new_bh = sb_getblk(p_s_sb, *p_n_blocknr); | |
36 | + p_s_new_bh = sb_getblk(sb, *p_n_blocknr); | |
37 | RFALSE(buffer_dirty(p_s_new_bh) || | |
38 | buffer_journaled(p_s_new_bh) || | |
39 | buffer_journal_dirty(p_s_new_bh), | |
40 | @@ -899,7 +899,7 @@ static int get_rfree(struct tree_balance | |
41 | static int is_left_neighbor_in_cache(struct tree_balance *p_s_tb, int n_h) | |
42 | { | |
43 | struct buffer_head *p_s_father, *left; | |
44 | - struct super_block *p_s_sb = p_s_tb->tb_sb; | |
45 | + struct super_block *sb = p_s_tb->tb_sb; | |
46 | b_blocknr_t n_left_neighbor_blocknr; | |
47 | int n_left_neighbor_position; | |
48 | ||
49 | @@ -924,7 +924,7 @@ static int is_left_neighbor_in_cache(str | |
50 | n_left_neighbor_blocknr = | |
51 | B_N_CHILD_NUM(p_s_tb->FL[n_h], n_left_neighbor_position); | |
52 | /* Look for the left neighbor in the cache. */ | |
53 | - if ((left = sb_find_get_block(p_s_sb, n_left_neighbor_blocknr))) { | |
54 | + if ((left = sb_find_get_block(sb, n_left_neighbor_blocknr))) { | |
55 | ||
56 | RFALSE(buffer_uptodate(left) && !B_IS_IN_TREE(left), | |
57 | "vs-8170: left neighbor (%b %z) is not in the tree", | |
58 | @@ -1942,14 +1942,14 @@ static int get_neighbors(struct tree_bal | |
59 | int n_child_position, | |
60 | n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h + 1); | |
61 | unsigned long n_son_number; | |
62 | - struct super_block *p_s_sb = p_s_tb->tb_sb; | |
63 | + struct super_block *sb = p_s_tb->tb_sb; | |
64 | struct buffer_head *p_s_bh; | |
65 | ||
66 | - PROC_INFO_INC(p_s_sb, get_neighbors[n_h]); | |
67 | + PROC_INFO_INC(sb, get_neighbors[n_h]); | |
68 | ||
69 | if (p_s_tb->lnum[n_h]) { | |
70 | /* We need left neighbor to balance S[n_h]. */ | |
71 | - PROC_INFO_INC(p_s_sb, need_l_neighbor[n_h]); | |
72 | + PROC_INFO_INC(sb, need_l_neighbor[n_h]); | |
73 | p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); | |
74 | ||
75 | RFALSE(p_s_bh == p_s_tb->FL[n_h] && | |
76 | @@ -1961,12 +1961,12 @@ static int get_neighbors(struct tree_bal | |
77 | p_s_tb->FL[n_h]) ? p_s_tb->lkey[n_h] : B_NR_ITEMS(p_s_tb-> | |
78 | FL[n_h]); | |
79 | n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position); | |
80 | - p_s_bh = sb_bread(p_s_sb, n_son_number); | |
81 | + p_s_bh = sb_bread(sb, n_son_number); | |
82 | if (!p_s_bh) | |
83 | return IO_ERROR; | |
84 | if (FILESYSTEM_CHANGED_TB(p_s_tb)) { | |
85 | brelse(p_s_bh); | |
86 | - PROC_INFO_INC(p_s_sb, get_neighbors_restart[n_h]); | |
87 | + PROC_INFO_INC(sb, get_neighbors_restart[n_h]); | |
88 | return REPEAT_SEARCH; | |
89 | } | |
90 | ||
91 | @@ -1986,7 +1986,7 @@ static int get_neighbors(struct tree_bal | |
92 | } | |
93 | ||
94 | if (p_s_tb->rnum[n_h]) { /* We need right neighbor to balance S[n_path_offset]. */ | |
95 | - PROC_INFO_INC(p_s_sb, need_r_neighbor[n_h]); | |
96 | + PROC_INFO_INC(sb, need_r_neighbor[n_h]); | |
97 | p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); | |
98 | ||
99 | RFALSE(p_s_bh == p_s_tb->FR[n_h] && | |
100 | @@ -1998,12 +1998,12 @@ static int get_neighbors(struct tree_bal | |
101 | n_child_position = | |
102 | (p_s_bh == p_s_tb->FR[n_h]) ? p_s_tb->rkey[n_h] + 1 : 0; | |
103 | n_son_number = B_N_CHILD_NUM(p_s_tb->FR[n_h], n_child_position); | |
104 | - p_s_bh = sb_bread(p_s_sb, n_son_number); | |
105 | + p_s_bh = sb_bread(sb, n_son_number); | |
106 | if (!p_s_bh) | |
107 | return IO_ERROR; | |
108 | if (FILESYSTEM_CHANGED_TB(p_s_tb)) { | |
109 | brelse(p_s_bh); | |
110 | - PROC_INFO_INC(p_s_sb, get_neighbors_restart[n_h]); | |
111 | + PROC_INFO_INC(sb, get_neighbors_restart[n_h]); | |
112 | return REPEAT_SEARCH; | |
113 | } | |
114 | brelse(p_s_tb->R[n_h]); | |
115 | @@ -2089,51 +2089,51 @@ static int get_mem_for_virtual_node(stru | |
116 | } | |
117 | ||
118 | #ifdef CONFIG_REISERFS_CHECK | |
119 | -static void tb_buffer_sanity_check(struct super_block *p_s_sb, | |
120 | +static void tb_buffer_sanity_check(struct super_block *sb, | |
121 | struct buffer_head *p_s_bh, | |
122 | const char *descr, int level) | |
123 | { | |
124 | if (p_s_bh) { | |
125 | if (atomic_read(&(p_s_bh->b_count)) <= 0) { | |
126 | ||
127 | - reiserfs_panic(p_s_sb, "jmacd-1", "negative or zero " | |
128 | + reiserfs_panic(sb, "jmacd-1", "negative or zero " | |
129 | "reference counter for buffer %s[%d] " | |
130 | "(%b)", descr, level, p_s_bh); | |
131 | } | |
132 | ||
133 | if (!buffer_uptodate(p_s_bh)) { | |
134 | - reiserfs_panic(p_s_sb, "jmacd-2", "buffer is not up " | |
135 | + reiserfs_panic(sb, "jmacd-2", "buffer is not up " | |
136 | "to date %s[%d] (%b)", | |
137 | descr, level, p_s_bh); | |
138 | } | |
139 | ||
140 | if (!B_IS_IN_TREE(p_s_bh)) { | |
141 | - reiserfs_panic(p_s_sb, "jmacd-3", "buffer is not " | |
142 | + reiserfs_panic(sb, "jmacd-3", "buffer is not " | |
143 | "in tree %s[%d] (%b)", | |
144 | descr, level, p_s_bh); | |
145 | } | |
146 | ||
147 | - if (p_s_bh->b_bdev != p_s_sb->s_bdev) { | |
148 | - reiserfs_panic(p_s_sb, "jmacd-4", "buffer has wrong " | |
149 | + if (p_s_bh->b_bdev != sb->s_bdev) { | |
150 | + reiserfs_panic(sb, "jmacd-4", "buffer has wrong " | |
151 | "device %s[%d] (%b)", | |
152 | descr, level, p_s_bh); | |
153 | } | |
154 | ||
155 | - if (p_s_bh->b_size != p_s_sb->s_blocksize) { | |
156 | - reiserfs_panic(p_s_sb, "jmacd-5", "buffer has wrong " | |
157 | + if (p_s_bh->b_size != sb->s_blocksize) { | |
158 | + reiserfs_panic(sb, "jmacd-5", "buffer has wrong " | |
159 | "blocksize %s[%d] (%b)", | |
160 | descr, level, p_s_bh); | |
161 | } | |
162 | ||
163 | - if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { | |
164 | - reiserfs_panic(p_s_sb, "jmacd-6", "buffer block " | |
165 | + if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(sb)) { | |
166 | + reiserfs_panic(sb, "jmacd-6", "buffer block " | |
167 | "number too high %s[%d] (%b)", | |
168 | descr, level, p_s_bh); | |
169 | } | |
170 | } | |
171 | } | |
172 | #else | |
173 | -static void tb_buffer_sanity_check(struct super_block *p_s_sb, | |
174 | +static void tb_buffer_sanity_check(struct super_block *sb, | |
175 | struct buffer_head *p_s_bh, | |
176 | const char *descr, int level) | |
177 | {; | |
178 | --- a/fs/reiserfs/journal.c | |
179 | +++ b/fs/reiserfs/journal.c | |
180 | @@ -97,7 +97,7 @@ static int flush_commit_list(struct supe | |
181 | struct reiserfs_journal_list *jl, int flushall); | |
182 | static int can_dirty(struct reiserfs_journal_cnode *cn); | |
183 | static int journal_join(struct reiserfs_transaction_handle *th, | |
184 | - struct super_block *p_s_sb, unsigned long nblocks); | |
185 | + struct super_block *sb, unsigned long nblocks); | |
186 | static int release_journal_dev(struct super_block *super, | |
187 | struct reiserfs_journal *journal); | |
188 | static int dirty_one_transaction(struct super_block *s, | |
189 | @@ -113,12 +113,12 @@ enum { | |
190 | }; | |
191 | ||
192 | static int do_journal_begin_r(struct reiserfs_transaction_handle *th, | |
193 | - struct super_block *p_s_sb, | |
194 | + struct super_block *sb, | |
195 | unsigned long nblocks, int join); | |
196 | ||
197 | -static void init_journal_hash(struct super_block *p_s_sb) | |
198 | +static void init_journal_hash(struct super_block *sb) | |
199 | { | |
200 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
201 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
202 | memset(journal->j_hash_table, 0, | |
203 | JOURNAL_HASH_SIZE * sizeof(struct reiserfs_journal_cnode *)); | |
204 | } | |
205 | @@ -145,7 +145,7 @@ static void disable_barrier(struct super | |
206 | } | |
207 | ||
208 | static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block | |
209 | - *p_s_sb) | |
210 | + *sb) | |
211 | { | |
212 | struct reiserfs_bitmap_node *bn; | |
213 | static int id; | |
214 | @@ -154,7 +154,7 @@ static struct reiserfs_bitmap_node *allo | |
215 | if (!bn) { | |
216 | return NULL; | |
217 | } | |
218 | - bn->data = kzalloc(p_s_sb->s_blocksize, GFP_NOFS); | |
219 | + bn->data = kzalloc(sb->s_blocksize, GFP_NOFS); | |
220 | if (!bn->data) { | |
221 | kfree(bn); | |
222 | return NULL; | |
223 | @@ -164,9 +164,9 @@ static struct reiserfs_bitmap_node *allo | |
224 | return bn; | |
225 | } | |
226 | ||
227 | -static struct reiserfs_bitmap_node *get_bitmap_node(struct super_block *p_s_sb) | |
228 | +static struct reiserfs_bitmap_node *get_bitmap_node(struct super_block *sb) | |
229 | { | |
230 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
231 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
232 | struct reiserfs_bitmap_node *bn = NULL; | |
233 | struct list_head *entry = journal->j_bitmap_nodes.next; | |
234 | ||
235 | @@ -176,21 +176,21 @@ static struct reiserfs_bitmap_node *get_ | |
236 | if (entry != &journal->j_bitmap_nodes) { | |
237 | bn = list_entry(entry, struct reiserfs_bitmap_node, list); | |
238 | list_del(entry); | |
239 | - memset(bn->data, 0, p_s_sb->s_blocksize); | |
240 | + memset(bn->data, 0, sb->s_blocksize); | |
241 | journal->j_free_bitmap_nodes--; | |
242 | return bn; | |
243 | } | |
244 | - bn = allocate_bitmap_node(p_s_sb); | |
245 | + bn = allocate_bitmap_node(sb); | |
246 | if (!bn) { | |
247 | yield(); | |
248 | goto repeat; | |
249 | } | |
250 | return bn; | |
251 | } | |
252 | -static inline void free_bitmap_node(struct super_block *p_s_sb, | |
253 | +static inline void free_bitmap_node(struct super_block *sb, | |
254 | struct reiserfs_bitmap_node *bn) | |
255 | { | |
256 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
257 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
258 | journal->j_used_bitmap_nodes--; | |
259 | if (journal->j_free_bitmap_nodes > REISERFS_MAX_BITMAP_NODES) { | |
260 | kfree(bn->data); | |
261 | @@ -201,13 +201,13 @@ static inline void free_bitmap_node(stru | |
262 | } | |
263 | } | |
264 | ||
265 | -static void allocate_bitmap_nodes(struct super_block *p_s_sb) | |
266 | +static void allocate_bitmap_nodes(struct super_block *sb) | |
267 | { | |
268 | int i; | |
269 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
270 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
271 | struct reiserfs_bitmap_node *bn = NULL; | |
272 | for (i = 0; i < REISERFS_MIN_BITMAP_NODES; i++) { | |
273 | - bn = allocate_bitmap_node(p_s_sb); | |
274 | + bn = allocate_bitmap_node(sb); | |
275 | if (bn) { | |
276 | list_add(&bn->list, &journal->j_bitmap_nodes); | |
277 | journal->j_free_bitmap_nodes++; | |
278 | @@ -217,30 +217,30 @@ static void allocate_bitmap_nodes(struct | |
279 | } | |
280 | } | |
281 | ||
282 | -static int set_bit_in_list_bitmap(struct super_block *p_s_sb, | |
283 | +static int set_bit_in_list_bitmap(struct super_block *sb, | |
284 | b_blocknr_t block, | |
285 | struct reiserfs_list_bitmap *jb) | |
286 | { | |
287 | - unsigned int bmap_nr = block / (p_s_sb->s_blocksize << 3); | |
288 | - unsigned int bit_nr = block % (p_s_sb->s_blocksize << 3); | |
289 | + unsigned int bmap_nr = block / (sb->s_blocksize << 3); | |
290 | + unsigned int bit_nr = block % (sb->s_blocksize << 3); | |
291 | ||
292 | if (!jb->bitmaps[bmap_nr]) { | |
293 | - jb->bitmaps[bmap_nr] = get_bitmap_node(p_s_sb); | |
294 | + jb->bitmaps[bmap_nr] = get_bitmap_node(sb); | |
295 | } | |
296 | set_bit(bit_nr, (unsigned long *)jb->bitmaps[bmap_nr]->data); | |
297 | return 0; | |
298 | } | |
299 | ||
300 | -static void cleanup_bitmap_list(struct super_block *p_s_sb, | |
301 | +static void cleanup_bitmap_list(struct super_block *sb, | |
302 | struct reiserfs_list_bitmap *jb) | |
303 | { | |
304 | int i; | |
305 | if (jb->bitmaps == NULL) | |
306 | return; | |
307 | ||
308 | - for (i = 0; i < reiserfs_bmap_count(p_s_sb); i++) { | |
309 | + for (i = 0; i < reiserfs_bmap_count(sb); i++) { | |
310 | if (jb->bitmaps[i]) { | |
311 | - free_bitmap_node(p_s_sb, jb->bitmaps[i]); | |
312 | + free_bitmap_node(sb, jb->bitmaps[i]); | |
313 | jb->bitmaps[i] = NULL; | |
314 | } | |
315 | } | |
316 | @@ -249,7 +249,7 @@ static void cleanup_bitmap_list(struct s | |
317 | /* | |
318 | ** only call this on FS unmount. | |
319 | */ | |
320 | -static int free_list_bitmaps(struct super_block *p_s_sb, | |
321 | +static int free_list_bitmaps(struct super_block *sb, | |
322 | struct reiserfs_list_bitmap *jb_array) | |
323 | { | |
324 | int i; | |
325 | @@ -257,16 +257,16 @@ static int free_list_bitmaps(struct supe | |
326 | for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) { | |
327 | jb = jb_array + i; | |
328 | jb->journal_list = NULL; | |
329 | - cleanup_bitmap_list(p_s_sb, jb); | |
330 | + cleanup_bitmap_list(sb, jb); | |
331 | vfree(jb->bitmaps); | |
332 | jb->bitmaps = NULL; | |
333 | } | |
334 | return 0; | |
335 | } | |
336 | ||
337 | -static int free_bitmap_nodes(struct super_block *p_s_sb) | |
338 | +static int free_bitmap_nodes(struct super_block *sb) | |
339 | { | |
340 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
341 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
342 | struct list_head *next = journal->j_bitmap_nodes.next; | |
343 | struct reiserfs_bitmap_node *bn; | |
344 | ||
345 | @@ -286,7 +286,7 @@ static int free_bitmap_nodes(struct supe | |
346 | ** get memory for JOURNAL_NUM_BITMAPS worth of bitmaps. | |
347 | ** jb_array is the array to be filled in. | |
348 | */ | |
349 | -int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, | |
350 | +int reiserfs_allocate_list_bitmaps(struct super_block *sb, | |
351 | struct reiserfs_list_bitmap *jb_array, | |
352 | unsigned int bmap_nr) | |
353 | { | |
354 | @@ -300,7 +300,7 @@ int reiserfs_allocate_list_bitmaps(struc | |
355 | jb->journal_list = NULL; | |
356 | jb->bitmaps = vmalloc(mem); | |
357 | if (!jb->bitmaps) { | |
358 | - reiserfs_warning(p_s_sb, "clm-2000", "unable to " | |
359 | + reiserfs_warning(sb, "clm-2000", "unable to " | |
360 | "allocate bitmaps for journal lists"); | |
361 | failed = 1; | |
362 | break; | |
363 | @@ -308,7 +308,7 @@ int reiserfs_allocate_list_bitmaps(struc | |
364 | memset(jb->bitmaps, 0, mem); | |
365 | } | |
366 | if (failed) { | |
367 | - free_list_bitmaps(p_s_sb, jb_array); | |
368 | + free_list_bitmaps(sb, jb_array); | |
369 | return -1; | |
370 | } | |
371 | return 0; | |
372 | @@ -318,12 +318,12 @@ int reiserfs_allocate_list_bitmaps(struc | |
373 | ** find an available list bitmap. If you can't find one, flush a commit list | |
374 | ** and try again | |
375 | */ | |
376 | -static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *p_s_sb, | |
377 | +static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *sb, | |
378 | struct reiserfs_journal_list | |
379 | *jl) | |
380 | { | |
381 | int i, j; | |
382 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
383 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
384 | struct reiserfs_list_bitmap *jb = NULL; | |
385 | ||
386 | for (j = 0; j < (JOURNAL_NUM_BITMAPS * 3); j++) { | |
387 | @@ -331,7 +331,7 @@ static struct reiserfs_list_bitmap *get_ | |
388 | journal->j_list_bitmap_index = (i + 1) % JOURNAL_NUM_BITMAPS; | |
389 | jb = journal->j_list_bitmap + i; | |
390 | if (journal->j_list_bitmap[i].journal_list) { | |
391 | - flush_commit_list(p_s_sb, | |
392 | + flush_commit_list(sb, | |
393 | journal->j_list_bitmap[i]. | |
394 | journal_list, 1); | |
395 | if (!journal->j_list_bitmap[i].journal_list) { | |
396 | @@ -378,12 +378,12 @@ static struct reiserfs_journal_cnode *al | |
397 | /* | |
398 | ** pulls a cnode off the free list, or returns NULL on failure | |
399 | */ | |
400 | -static struct reiserfs_journal_cnode *get_cnode(struct super_block *p_s_sb) | |
401 | +static struct reiserfs_journal_cnode *get_cnode(struct super_block *sb) | |
402 | { | |
403 | struct reiserfs_journal_cnode *cn; | |
404 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
405 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
406 | ||
407 | - reiserfs_check_lock_depth(p_s_sb, "get_cnode"); | |
408 | + reiserfs_check_lock_depth(sb, "get_cnode"); | |
409 | ||
410 | if (journal->j_cnode_free <= 0) { | |
411 | return NULL; | |
412 | @@ -405,12 +405,12 @@ static struct reiserfs_journal_cnode *ge | |
413 | /* | |
414 | ** returns a cnode to the free list | |
415 | */ | |
416 | -static void free_cnode(struct super_block *p_s_sb, | |
417 | +static void free_cnode(struct super_block *sb, | |
418 | struct reiserfs_journal_cnode *cn) | |
419 | { | |
420 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
421 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
422 | ||
423 | - reiserfs_check_lock_depth(p_s_sb, "free_cnode"); | |
424 | + reiserfs_check_lock_depth(sb, "free_cnode"); | |
425 | ||
426 | journal->j_cnode_used--; | |
427 | journal->j_cnode_free++; | |
428 | @@ -481,11 +481,11 @@ static inline struct reiserfs_journal_cn | |
429 | ** reject it on the next call to reiserfs_in_journal | |
430 | ** | |
431 | */ | |
432 | -int reiserfs_in_journal(struct super_block *p_s_sb, | |
433 | +int reiserfs_in_journal(struct super_block *sb, | |
434 | unsigned int bmap_nr, int bit_nr, int search_all, | |
435 | b_blocknr_t * next_zero_bit) | |
436 | { | |
437 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
438 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
439 | struct reiserfs_journal_cnode *cn; | |
440 | struct reiserfs_list_bitmap *jb; | |
441 | int i; | |
442 | @@ -493,14 +493,14 @@ int reiserfs_in_journal(struct super_blo | |
443 | ||
444 | *next_zero_bit = 0; /* always start this at zero. */ | |
445 | ||
446 | - PROC_INFO_INC(p_s_sb, journal.in_journal); | |
447 | + PROC_INFO_INC(sb, journal.in_journal); | |
448 | /* If we aren't doing a search_all, this is a metablock, and it will be logged before use. | |
449 | ** if we crash before the transaction that freed it commits, this transaction won't | |
450 | ** have committed either, and the block will never be written | |
451 | */ | |
452 | if (search_all) { | |
453 | for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) { | |
454 | - PROC_INFO_INC(p_s_sb, journal.in_journal_bitmap); | |
455 | + PROC_INFO_INC(sb, journal.in_journal_bitmap); | |
456 | jb = journal->j_list_bitmap + i; | |
457 | if (jb->journal_list && jb->bitmaps[bmap_nr] && | |
458 | test_bit(bit_nr, | |
459 | @@ -510,28 +510,28 @@ int reiserfs_in_journal(struct super_blo | |
460 | find_next_zero_bit((unsigned long *) | |
461 | (jb->bitmaps[bmap_nr]-> | |
462 | data), | |
463 | - p_s_sb->s_blocksize << 3, | |
464 | + sb->s_blocksize << 3, | |
465 | bit_nr + 1); | |
466 | return 1; | |
467 | } | |
468 | } | |
469 | } | |
470 | ||
471 | - bl = bmap_nr * (p_s_sb->s_blocksize << 3) + bit_nr; | |
472 | + bl = bmap_nr * (sb->s_blocksize << 3) + bit_nr; | |
473 | /* is it in any old transactions? */ | |
474 | if (search_all | |
475 | && (cn = | |
476 | - get_journal_hash_dev(p_s_sb, journal->j_list_hash_table, bl))) { | |
477 | + get_journal_hash_dev(sb, journal->j_list_hash_table, bl))) { | |
478 | return 1; | |
479 | } | |
480 | ||
481 | /* is it in the current transaction. This should never happen */ | |
482 | - if ((cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, bl))) { | |
483 | + if ((cn = get_journal_hash_dev(sb, journal->j_hash_table, bl))) { | |
484 | BUG(); | |
485 | return 1; | |
486 | } | |
487 | ||
488 | - PROC_INFO_INC(p_s_sb, journal.in_journal_reusable); | |
489 | + PROC_INFO_INC(sb, journal.in_journal_reusable); | |
490 | /* safe for reuse */ | |
491 | return 0; | |
492 | } | |
493 | @@ -553,16 +553,16 @@ static inline void insert_journal_hash(s | |
494 | } | |
495 | ||
496 | /* lock the current transaction */ | |
497 | -static inline void lock_journal(struct super_block *p_s_sb) | |
498 | +static inline void lock_journal(struct super_block *sb) | |
499 | { | |
500 | - PROC_INFO_INC(p_s_sb, journal.lock_journal); | |
501 | - mutex_lock(&SB_JOURNAL(p_s_sb)->j_mutex); | |
502 | + PROC_INFO_INC(sb, journal.lock_journal); | |
503 | + mutex_lock(&SB_JOURNAL(sb)->j_mutex); | |
504 | } | |
505 | ||
506 | /* unlock the current transaction */ | |
507 | -static inline void unlock_journal(struct super_block *p_s_sb) | |
508 | +static inline void unlock_journal(struct super_block *sb) | |
509 | { | |
510 | - mutex_unlock(&SB_JOURNAL(p_s_sb)->j_mutex); | |
511 | + mutex_unlock(&SB_JOURNAL(sb)->j_mutex); | |
512 | } | |
513 | ||
514 | static inline void get_journal_list(struct reiserfs_journal_list *jl) | |
515 | @@ -586,13 +586,13 @@ static inline void put_journal_list(stru | |
516 | ** it gets called by flush_commit_list, and cleans up any data stored about blocks freed during a | |
517 | ** transaction. | |
518 | */ | |
519 | -static void cleanup_freed_for_journal_list(struct super_block *p_s_sb, | |
520 | +static void cleanup_freed_for_journal_list(struct super_block *sb, | |
521 | struct reiserfs_journal_list *jl) | |
522 | { | |
523 | ||
524 | struct reiserfs_list_bitmap *jb = jl->j_list_bitmap; | |
525 | if (jb) { | |
526 | - cleanup_bitmap_list(p_s_sb, jb); | |
527 | + cleanup_bitmap_list(sb, jb); | |
528 | } | |
529 | jl->j_list_bitmap->journal_list = NULL; | |
530 | jl->j_list_bitmap = NULL; | |
531 | @@ -1237,11 +1237,11 @@ static void remove_journal_hash(struct s | |
532 | ** journal list for this transaction. Aside from freeing the cnode, this also allows the | |
533 | ** block to be reallocated for data blocks if it had been deleted. | |
534 | */ | |
535 | -static void remove_all_from_journal_list(struct super_block *p_s_sb, | |
536 | +static void remove_all_from_journal_list(struct super_block *sb, | |
537 | struct reiserfs_journal_list *jl, | |
538 | int debug) | |
539 | { | |
540 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
541 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
542 | struct reiserfs_journal_cnode *cn, *last; | |
543 | cn = jl->j_realblock; | |
544 | ||
545 | @@ -1251,18 +1251,18 @@ static void remove_all_from_journal_list | |
546 | while (cn) { | |
547 | if (cn->blocknr != 0) { | |
548 | if (debug) { | |
549 | - reiserfs_warning(p_s_sb, "reiserfs-2201", | |
550 | + reiserfs_warning(sb, "reiserfs-2201", | |
551 | "block %u, bh is %d, state %ld", | |
552 | cn->blocknr, cn->bh ? 1 : 0, | |
553 | cn->state); | |
554 | } | |
555 | cn->state = 0; | |
556 | - remove_journal_hash(p_s_sb, journal->j_list_hash_table, | |
557 | + remove_journal_hash(sb, journal->j_list_hash_table, | |
558 | jl, cn->blocknr, 1); | |
559 | } | |
560 | last = cn; | |
561 | cn = cn->next; | |
562 | - free_cnode(p_s_sb, last); | |
563 | + free_cnode(sb, last); | |
564 | } | |
565 | jl->j_realblock = NULL; | |
566 | } | |
567 | @@ -1274,12 +1274,12 @@ static void remove_all_from_journal_list | |
568 | ** called by flush_journal_list, before it calls remove_all_from_journal_list | |
569 | ** | |
570 | */ | |
571 | -static int _update_journal_header_block(struct super_block *p_s_sb, | |
572 | +static int _update_journal_header_block(struct super_block *sb, | |
573 | unsigned long offset, | |
574 | unsigned int trans_id) | |
575 | { | |
576 | struct reiserfs_journal_header *jh; | |
577 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
578 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
579 | ||
580 | if (reiserfs_is_journal_aborted(journal)) | |
581 | return -EIO; | |
582 | @@ -1289,7 +1289,7 @@ static int _update_journal_header_block( | |
583 | wait_on_buffer((journal->j_header_bh)); | |
584 | if (unlikely(!buffer_uptodate(journal->j_header_bh))) { | |
585 | #ifdef CONFIG_REISERFS_CHECK | |
586 | - reiserfs_warning(p_s_sb, "journal-699", | |
587 | + reiserfs_warning(sb, "journal-699", | |
588 | "buffer write failed"); | |
589 | #endif | |
590 | return -EIO; | |
591 | @@ -1303,24 +1303,24 @@ static int _update_journal_header_block( | |
592 | jh->j_first_unflushed_offset = cpu_to_le32(offset); | |
593 | jh->j_mount_id = cpu_to_le32(journal->j_mount_id); | |
594 | ||
595 | - if (reiserfs_barrier_flush(p_s_sb)) { | |
596 | + if (reiserfs_barrier_flush(sb)) { | |
597 | int ret; | |
598 | lock_buffer(journal->j_header_bh); | |
599 | ret = submit_barrier_buffer(journal->j_header_bh); | |
600 | if (ret == -EOPNOTSUPP) { | |
601 | set_buffer_uptodate(journal->j_header_bh); | |
602 | - disable_barrier(p_s_sb); | |
603 | + disable_barrier(sb); | |
604 | goto sync; | |
605 | } | |
606 | wait_on_buffer(journal->j_header_bh); | |
607 | - check_barrier_completion(p_s_sb, journal->j_header_bh); | |
608 | + check_barrier_completion(sb, journal->j_header_bh); | |
609 | } else { | |
610 | sync: | |
611 | set_buffer_dirty(journal->j_header_bh); | |
612 | sync_dirty_buffer(journal->j_header_bh); | |
613 | } | |
614 | if (!buffer_uptodate(journal->j_header_bh)) { | |
615 | - reiserfs_warning(p_s_sb, "journal-837", | |
616 | + reiserfs_warning(sb, "journal-837", | |
617 | "IO error during journal replay"); | |
618 | return -EIO; | |
619 | } | |
620 | @@ -1328,23 +1328,23 @@ static int _update_journal_header_block( | |
621 | return 0; | |
622 | } | |
623 | ||
624 | -static int update_journal_header_block(struct super_block *p_s_sb, | |
625 | +static int update_journal_header_block(struct super_block *sb, | |
626 | unsigned long offset, | |
627 | unsigned int trans_id) | |
628 | { | |
629 | - return _update_journal_header_block(p_s_sb, offset, trans_id); | |
630 | + return _update_journal_header_block(sb, offset, trans_id); | |
631 | } | |
632 | ||
633 | /* | |
634 | ** flush any and all journal lists older than you are | |
635 | ** can only be called from flush_journal_list | |
636 | */ | |
637 | -static int flush_older_journal_lists(struct super_block *p_s_sb, | |
638 | +static int flush_older_journal_lists(struct super_block *sb, | |
639 | struct reiserfs_journal_list *jl) | |
640 | { | |
641 | struct list_head *entry; | |
642 | struct reiserfs_journal_list *other_jl; | |
643 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
644 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
645 | unsigned int trans_id = jl->j_trans_id; | |
646 | ||
647 | /* we know we are the only ones flushing things, no extra race | |
648 | @@ -1359,7 +1359,7 @@ static int flush_older_journal_lists(str | |
649 | if (other_jl->j_trans_id < trans_id) { | |
650 | BUG_ON(other_jl->j_refcount <= 0); | |
651 | /* do not flush all */ | |
652 | - flush_journal_list(p_s_sb, other_jl, 0); | |
653 | + flush_journal_list(sb, other_jl, 0); | |
654 | ||
655 | /* other_jl is now deleted from the list */ | |
656 | goto restart; | |
657 | @@ -1908,22 +1908,22 @@ void remove_journal_hash(struct super_bl | |
658 | } | |
659 | } | |
660 | ||
661 | -static void free_journal_ram(struct super_block *p_s_sb) | |
662 | +static void free_journal_ram(struct super_block *sb) | |
663 | { | |
664 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
665 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
666 | kfree(journal->j_current_jl); | |
667 | journal->j_num_lists--; | |
668 | ||
669 | vfree(journal->j_cnode_free_orig); | |
670 | - free_list_bitmaps(p_s_sb, journal->j_list_bitmap); | |
671 | - free_bitmap_nodes(p_s_sb); /* must be after free_list_bitmaps */ | |
672 | + free_list_bitmaps(sb, journal->j_list_bitmap); | |
673 | + free_bitmap_nodes(sb); /* must be after free_list_bitmaps */ | |
674 | if (journal->j_header_bh) { | |
675 | brelse(journal->j_header_bh); | |
676 | } | |
677 | /* j_header_bh is on the journal dev, make sure not to release the journal | |
678 | * dev until we brelse j_header_bh | |
679 | */ | |
680 | - release_journal_dev(p_s_sb, journal); | |
681 | + release_journal_dev(sb, journal); | |
682 | vfree(journal); | |
683 | } | |
684 | ||
685 | @@ -1932,27 +1932,27 @@ static void free_journal_ram(struct supe | |
686 | ** of read_super() yet. Any other caller must keep error at 0. | |
687 | */ | |
688 | static int do_journal_release(struct reiserfs_transaction_handle *th, | |
689 | - struct super_block *p_s_sb, int error) | |
690 | + struct super_block *sb, int error) | |
691 | { | |
692 | struct reiserfs_transaction_handle myth; | |
693 | int flushed = 0; | |
694 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
695 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
696 | ||
697 | /* we only want to flush out transactions if we were called with error == 0 | |
698 | */ | |
699 | - if (!error && !(p_s_sb->s_flags & MS_RDONLY)) { | |
700 | + if (!error && !(sb->s_flags & MS_RDONLY)) { | |
701 | /* end the current trans */ | |
702 | BUG_ON(!th->t_trans_id); | |
703 | - do_journal_end(th, p_s_sb, 10, FLUSH_ALL); | |
704 | + do_journal_end(th, sb, 10, FLUSH_ALL); | |
705 | ||
706 | /* make sure something gets logged to force our way into the flush code */ | |
707 | - if (!journal_join(&myth, p_s_sb, 1)) { | |
708 | - reiserfs_prepare_for_journal(p_s_sb, | |
709 | - SB_BUFFER_WITH_SB(p_s_sb), | |
710 | + if (!journal_join(&myth, sb, 1)) { | |
711 | + reiserfs_prepare_for_journal(sb, | |
712 | + SB_BUFFER_WITH_SB(sb), | |
713 | 1); | |
714 | - journal_mark_dirty(&myth, p_s_sb, | |
715 | - SB_BUFFER_WITH_SB(p_s_sb)); | |
716 | - do_journal_end(&myth, p_s_sb, 1, FLUSH_ALL); | |
717 | + journal_mark_dirty(&myth, sb, | |
718 | + SB_BUFFER_WITH_SB(sb)); | |
719 | + do_journal_end(&myth, sb, 1, FLUSH_ALL); | |
720 | flushed = 1; | |
721 | } | |
722 | } | |
723 | @@ -1960,26 +1960,26 @@ static int do_journal_release(struct rei | |
724 | /* this also catches errors during the do_journal_end above */ | |
725 | if (!error && reiserfs_is_journal_aborted(journal)) { | |
726 | memset(&myth, 0, sizeof(myth)); | |
727 | - if (!journal_join_abort(&myth, p_s_sb, 1)) { | |
728 | - reiserfs_prepare_for_journal(p_s_sb, | |
729 | - SB_BUFFER_WITH_SB(p_s_sb), | |
730 | + if (!journal_join_abort(&myth, sb, 1)) { | |
731 | + reiserfs_prepare_for_journal(sb, | |
732 | + SB_BUFFER_WITH_SB(sb), | |
733 | 1); | |
734 | - journal_mark_dirty(&myth, p_s_sb, | |
735 | - SB_BUFFER_WITH_SB(p_s_sb)); | |
736 | - do_journal_end(&myth, p_s_sb, 1, FLUSH_ALL); | |
737 | + journal_mark_dirty(&myth, sb, | |
738 | + SB_BUFFER_WITH_SB(sb)); | |
739 | + do_journal_end(&myth, sb, 1, FLUSH_ALL); | |
740 | } | |
741 | } | |
742 | ||
743 | reiserfs_mounted_fs_count--; | |
744 | /* wait for all commits to finish */ | |
745 | - cancel_delayed_work(&SB_JOURNAL(p_s_sb)->j_work); | |
746 | + cancel_delayed_work(&SB_JOURNAL(sb)->j_work); | |
747 | flush_workqueue(commit_wq); | |
748 | if (!reiserfs_mounted_fs_count) { | |
749 | destroy_workqueue(commit_wq); | |
750 | commit_wq = NULL; | |
751 | } | |
752 | ||
753 | - free_journal_ram(p_s_sb); | |
754 | + free_journal_ram(sb); | |
755 | ||
756 | return 0; | |
757 | } | |
758 | @@ -1988,28 +1988,28 @@ static int do_journal_release(struct rei | |
759 | ** call on unmount. flush all journal trans, release all alloc'd ram | |
760 | */ | |
761 | int journal_release(struct reiserfs_transaction_handle *th, | |
762 | - struct super_block *p_s_sb) | |
763 | + struct super_block *sb) | |
764 | { | |
765 | - return do_journal_release(th, p_s_sb, 0); | |
766 | + return do_journal_release(th, sb, 0); | |
767 | } | |
768 | ||
769 | /* | |
770 | ** only call from an error condition inside reiserfs_read_super! | |
771 | */ | |
772 | int journal_release_error(struct reiserfs_transaction_handle *th, | |
773 | - struct super_block *p_s_sb) | |
774 | + struct super_block *sb) | |
775 | { | |
776 | - return do_journal_release(th, p_s_sb, 1); | |
777 | + return do_journal_release(th, sb, 1); | |
778 | } | |
779 | ||
780 | /* compares description block with commit block. returns 1 if they differ, 0 if they are the same */ | |
781 | -static int journal_compare_desc_commit(struct super_block *p_s_sb, | |
782 | +static int journal_compare_desc_commit(struct super_block *sb, | |
783 | struct reiserfs_journal_desc *desc, | |
784 | struct reiserfs_journal_commit *commit) | |
785 | { | |
786 | if (get_commit_trans_id(commit) != get_desc_trans_id(desc) || | |
787 | get_commit_trans_len(commit) != get_desc_trans_len(desc) || | |
788 | - get_commit_trans_len(commit) > SB_JOURNAL(p_s_sb)->j_trans_max || | |
789 | + get_commit_trans_len(commit) > SB_JOURNAL(sb)->j_trans_max || | |
790 | get_commit_trans_len(commit) <= 0) { | |
791 | return 1; | |
792 | } | |
793 | @@ -2020,7 +2020,7 @@ static int journal_compare_desc_commit(s | |
794 | ** returns -1 if it found a corrupt commit block | |
795 | ** returns 1 if both desc and commit were valid | |
796 | */ | |
797 | -static int journal_transaction_is_valid(struct super_block *p_s_sb, | |
798 | +static int journal_transaction_is_valid(struct super_block *sb, | |
799 | struct buffer_head *d_bh, | |
800 | unsigned int *oldest_invalid_trans_id, | |
801 | unsigned long *newest_mount_id) | |
802 | @@ -2038,7 +2038,7 @@ static int journal_transaction_is_valid( | |
803 | && !memcmp(get_journal_desc_magic(d_bh), JOURNAL_DESC_MAGIC, 8)) { | |
804 | if (oldest_invalid_trans_id && *oldest_invalid_trans_id | |
805 | && get_desc_trans_id(desc) > *oldest_invalid_trans_id) { | |
806 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
807 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
808 | "journal-986: transaction " | |
809 | "is valid returning because trans_id %d is greater than " | |
810 | "oldest_invalid %lu", | |
811 | @@ -2048,7 +2048,7 @@ static int journal_transaction_is_valid( | |
812 | } | |
813 | if (newest_mount_id | |
814 | && *newest_mount_id > get_desc_mount_id(desc)) { | |
815 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
816 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
817 | "journal-1087: transaction " | |
818 | "is valid returning because mount_id %d is less than " | |
819 | "newest_mount_id %lu", | |
820 | @@ -2056,37 +2056,37 @@ static int journal_transaction_is_valid( | |
821 | *newest_mount_id); | |
822 | return -1; | |
823 | } | |
824 | - if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) { | |
825 | - reiserfs_warning(p_s_sb, "journal-2018", | |
826 | + if (get_desc_trans_len(desc) > SB_JOURNAL(sb)->j_trans_max) { | |
827 | + reiserfs_warning(sb, "journal-2018", | |
828 | "Bad transaction length %d " | |
829 | "encountered, ignoring transaction", | |
830 | get_desc_trans_len(desc)); | |
831 | return -1; | |
832 | } | |
833 | - offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); | |
834 | + offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb); | |
835 | ||
836 | /* ok, we have a journal description block, lets see if the transaction was valid */ | |
837 | c_bh = | |
838 | - journal_bread(p_s_sb, | |
839 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
840 | + journal_bread(sb, | |
841 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
842 | ((offset + get_desc_trans_len(desc) + | |
843 | - 1) % SB_ONDISK_JOURNAL_SIZE(p_s_sb))); | |
844 | + 1) % SB_ONDISK_JOURNAL_SIZE(sb))); | |
845 | if (!c_bh) | |
846 | return 0; | |
847 | commit = (struct reiserfs_journal_commit *)c_bh->b_data; | |
848 | - if (journal_compare_desc_commit(p_s_sb, desc, commit)) { | |
849 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
850 | + if (journal_compare_desc_commit(sb, desc, commit)) { | |
851 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
852 | "journal_transaction_is_valid, commit offset %ld had bad " | |
853 | "time %d or length %d", | |
854 | c_bh->b_blocknr - | |
855 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), | |
856 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb), | |
857 | get_commit_trans_id(commit), | |
858 | get_commit_trans_len(commit)); | |
859 | brelse(c_bh); | |
860 | if (oldest_invalid_trans_id) { | |
861 | *oldest_invalid_trans_id = | |
862 | get_desc_trans_id(desc); | |
863 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
864 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
865 | "journal-1004: " | |
866 | "transaction_is_valid setting oldest invalid trans_id " | |
867 | "to %d", | |
868 | @@ -2095,11 +2095,11 @@ static int journal_transaction_is_valid( | |
869 | return -1; | |
870 | } | |
871 | brelse(c_bh); | |
872 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
873 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
874 | "journal-1006: found valid " | |
875 | "transaction start offset %llu, len %d id %d", | |
876 | d_bh->b_blocknr - | |
877 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), | |
878 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb), | |
879 | get_desc_trans_len(desc), | |
880 | get_desc_trans_id(desc)); | |
881 | return 1; | |
882 | @@ -2121,13 +2121,13 @@ static void brelse_array(struct buffer_h | |
883 | ** this either reads in a replays a transaction, or returns because the transaction | |
884 | ** is invalid, or too old. | |
885 | */ | |
886 | -static int journal_read_transaction(struct super_block *p_s_sb, | |
887 | +static int journal_read_transaction(struct super_block *sb, | |
888 | unsigned long cur_dblock, | |
889 | unsigned long oldest_start, | |
890 | unsigned int oldest_trans_id, | |
891 | unsigned long newest_mount_id) | |
892 | { | |
893 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
894 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
895 | struct reiserfs_journal_desc *desc; | |
896 | struct reiserfs_journal_commit *commit; | |
897 | unsigned int trans_id = 0; | |
898 | @@ -2139,45 +2139,45 @@ static int journal_read_transaction(stru | |
899 | int i; | |
900 | int trans_half; | |
901 | ||
902 | - d_bh = journal_bread(p_s_sb, cur_dblock); | |
903 | + d_bh = journal_bread(sb, cur_dblock); | |
904 | if (!d_bh) | |
905 | return 1; | |
906 | desc = (struct reiserfs_journal_desc *)d_bh->b_data; | |
907 | - trans_offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); | |
908 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1037: " | |
909 | + trans_offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb); | |
910 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1037: " | |
911 | "journal_read_transaction, offset %llu, len %d mount_id %d", | |
912 | - d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), | |
913 | + d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb), | |
914 | get_desc_trans_len(desc), get_desc_mount_id(desc)); | |
915 | if (get_desc_trans_id(desc) < oldest_trans_id) { | |
916 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1039: " | |
917 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1039: " | |
918 | "journal_read_trans skipping because %lu is too old", | |
919 | cur_dblock - | |
920 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)); | |
921 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb)); | |
922 | brelse(d_bh); | |
923 | return 1; | |
924 | } | |
925 | if (get_desc_mount_id(desc) != newest_mount_id) { | |
926 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1146: " | |
927 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1146: " | |
928 | "journal_read_trans skipping because %d is != " | |
929 | "newest_mount_id %lu", get_desc_mount_id(desc), | |
930 | newest_mount_id); | |
931 | brelse(d_bh); | |
932 | return 1; | |
933 | } | |
934 | - c_bh = journal_bread(p_s_sb, SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
935 | + c_bh = journal_bread(sb, SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
936 | ((trans_offset + get_desc_trans_len(desc) + 1) % | |
937 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb))); | |
938 | + SB_ONDISK_JOURNAL_SIZE(sb))); | |
939 | if (!c_bh) { | |
940 | brelse(d_bh); | |
941 | return 1; | |
942 | } | |
943 | commit = (struct reiserfs_journal_commit *)c_bh->b_data; | |
944 | - if (journal_compare_desc_commit(p_s_sb, desc, commit)) { | |
945 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
946 | + if (journal_compare_desc_commit(sb, desc, commit)) { | |
947 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
948 | "journal_read_transaction, " | |
949 | "commit offset %llu had bad time %d or length %d", | |
950 | c_bh->b_blocknr - | |
951 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), | |
952 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb), | |
953 | get_commit_trans_id(commit), | |
954 | get_commit_trans_len(commit)); | |
955 | brelse(c_bh); | |
956 | @@ -2195,30 +2195,30 @@ static int journal_read_transaction(stru | |
957 | brelse(d_bh); | |
958 | kfree(log_blocks); | |
959 | kfree(real_blocks); | |
960 | - reiserfs_warning(p_s_sb, "journal-1169", | |
961 | + reiserfs_warning(sb, "journal-1169", | |
962 | "kmalloc failed, unable to mount FS"); | |
963 | return -1; | |
964 | } | |
965 | /* get all the buffer heads */ | |
966 | - trans_half = journal_trans_half(p_s_sb->s_blocksize); | |
967 | + trans_half = journal_trans_half(sb->s_blocksize); | |
968 | for (i = 0; i < get_desc_trans_len(desc); i++) { | |
969 | log_blocks[i] = | |
970 | - journal_getblk(p_s_sb, | |
971 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
972 | + journal_getblk(sb, | |
973 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
974 | (trans_offset + 1 + | |
975 | - i) % SB_ONDISK_JOURNAL_SIZE(p_s_sb)); | |
976 | + i) % SB_ONDISK_JOURNAL_SIZE(sb)); | |
977 | if (i < trans_half) { | |
978 | real_blocks[i] = | |
979 | - sb_getblk(p_s_sb, | |
980 | + sb_getblk(sb, | |
981 | le32_to_cpu(desc->j_realblock[i])); | |
982 | } else { | |
983 | real_blocks[i] = | |
984 | - sb_getblk(p_s_sb, | |
985 | + sb_getblk(sb, | |
986 | le32_to_cpu(commit-> | |
987 | j_realblock[i - trans_half])); | |
988 | } | |
989 | - if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { | |
990 | - reiserfs_warning(p_s_sb, "journal-1207", | |
991 | + if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(sb)) { | |
992 | + reiserfs_warning(sb, "journal-1207", | |
993 | "REPLAY FAILURE fsck required! " | |
994 | "Block to replay is outside of " | |
995 | "filesystem"); | |
996 | @@ -2226,8 +2226,8 @@ static int journal_read_transaction(stru | |
997 | } | |
998 | /* make sure we don't try to replay onto log or reserved area */ | |
999 | if (is_block_in_log_or_reserved_area | |
1000 | - (p_s_sb, real_blocks[i]->b_blocknr)) { | |
1001 | - reiserfs_warning(p_s_sb, "journal-1204", | |
1002 | + (sb, real_blocks[i]->b_blocknr)) { | |
1003 | + reiserfs_warning(sb, "journal-1204", | |
1004 | "REPLAY FAILURE fsck required! " | |
1005 | "Trying to replay onto a log block"); | |
1006 | abort_replay: | |
1007 | @@ -2245,7 +2245,7 @@ static int journal_read_transaction(stru | |
1008 | for (i = 0; i < get_desc_trans_len(desc); i++) { | |
1009 | wait_on_buffer(log_blocks[i]); | |
1010 | if (!buffer_uptodate(log_blocks[i])) { | |
1011 | - reiserfs_warning(p_s_sb, "journal-1212", | |
1012 | + reiserfs_warning(sb, "journal-1212", | |
1013 | "REPLAY FAILURE fsck required! " | |
1014 | "buffer write failed"); | |
1015 | brelse_array(log_blocks + i, | |
1016 | @@ -2270,7 +2270,7 @@ static int journal_read_transaction(stru | |
1017 | for (i = 0; i < get_desc_trans_len(desc); i++) { | |
1018 | wait_on_buffer(real_blocks[i]); | |
1019 | if (!buffer_uptodate(real_blocks[i])) { | |
1020 | - reiserfs_warning(p_s_sb, "journal-1226", | |
1021 | + reiserfs_warning(sb, "journal-1226", | |
1022 | "REPLAY FAILURE, fsck required! " | |
1023 | "buffer write failed"); | |
1024 | brelse_array(real_blocks + i, | |
1025 | @@ -2284,15 +2284,15 @@ static int journal_read_transaction(stru | |
1026 | brelse(real_blocks[i]); | |
1027 | } | |
1028 | cur_dblock = | |
1029 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
1030 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
1031 | ((trans_offset + get_desc_trans_len(desc) + | |
1032 | - 2) % SB_ONDISK_JOURNAL_SIZE(p_s_sb)); | |
1033 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
1034 | + 2) % SB_ONDISK_JOURNAL_SIZE(sb)); | |
1035 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
1036 | "journal-1095: setting journal " "start to offset %ld", | |
1037 | - cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)); | |
1038 | + cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb)); | |
1039 | ||
1040 | /* init starting values for the first transaction, in case this is the last transaction to be replayed. */ | |
1041 | - journal->j_start = cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); | |
1042 | + journal->j_start = cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb); | |
1043 | journal->j_last_flush_trans_id = trans_id; | |
1044 | journal->j_trans_id = trans_id + 1; | |
1045 | /* check for trans_id overflow */ | |
1046 | @@ -2357,9 +2357,9 @@ static struct buffer_head *reiserfs_brea | |
1047 | ** | |
1048 | ** On exit, it sets things up so the first transaction will work correctly. | |
1049 | */ | |
1050 | -static int journal_read(struct super_block *p_s_sb) | |
1051 | +static int journal_read(struct super_block *sb) | |
1052 | { | |
1053 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1054 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1055 | struct reiserfs_journal_desc *desc; | |
1056 | unsigned int oldest_trans_id = 0; | |
1057 | unsigned int oldest_invalid_trans_id = 0; | |
1058 | @@ -2375,8 +2375,8 @@ static int journal_read(struct super_blo | |
1059 | int ret; | |
1060 | char b[BDEVNAME_SIZE]; | |
1061 | ||
1062 | - cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); | |
1063 | - reiserfs_info(p_s_sb, "checking transaction log (%s)\n", | |
1064 | + cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(sb); | |
1065 | + reiserfs_info(sb, "checking transaction log (%s)\n", | |
1066 | bdevname(journal->j_dev_bd, b)); | |
1067 | start = get_seconds(); | |
1068 | ||
1069 | @@ -2384,22 +2384,22 @@ static int journal_read(struct super_blo | |
1070 | ** is the first unflushed, and if that transaction is not valid, | |
1071 | ** replay is done | |
1072 | */ | |
1073 | - journal->j_header_bh = journal_bread(p_s_sb, | |
1074 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) | |
1075 | - + SB_ONDISK_JOURNAL_SIZE(p_s_sb)); | |
1076 | + journal->j_header_bh = journal_bread(sb, | |
1077 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) | |
1078 | + + SB_ONDISK_JOURNAL_SIZE(sb)); | |
1079 | if (!journal->j_header_bh) { | |
1080 | return 1; | |
1081 | } | |
1082 | jh = (struct reiserfs_journal_header *)(journal->j_header_bh->b_data); | |
1083 | if (le32_to_cpu(jh->j_first_unflushed_offset) < | |
1084 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb) | |
1085 | + SB_ONDISK_JOURNAL_SIZE(sb) | |
1086 | && le32_to_cpu(jh->j_last_flush_trans_id) > 0) { | |
1087 | oldest_start = | |
1088 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
1089 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
1090 | le32_to_cpu(jh->j_first_unflushed_offset); | |
1091 | oldest_trans_id = le32_to_cpu(jh->j_last_flush_trans_id) + 1; | |
1092 | newest_mount_id = le32_to_cpu(jh->j_mount_id); | |
1093 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
1094 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
1095 | "journal-1153: found in " | |
1096 | "header: first_unflushed_offset %d, last_flushed_trans_id " | |
1097 | "%lu", le32_to_cpu(jh->j_first_unflushed_offset), | |
1098 | @@ -2411,10 +2411,10 @@ static int journal_read(struct super_blo | |
1099 | ** through the whole log. | |
1100 | */ | |
1101 | d_bh = | |
1102 | - journal_bread(p_s_sb, | |
1103 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
1104 | + journal_bread(sb, | |
1105 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
1106 | le32_to_cpu(jh->j_first_unflushed_offset)); | |
1107 | - ret = journal_transaction_is_valid(p_s_sb, d_bh, NULL, NULL); | |
1108 | + ret = journal_transaction_is_valid(sb, d_bh, NULL, NULL); | |
1109 | if (!ret) { | |
1110 | continue_replay = 0; | |
1111 | } | |
1112 | @@ -2422,8 +2422,8 @@ static int journal_read(struct super_blo | |
1113 | goto start_log_replay; | |
1114 | } | |
1115 | ||
1116 | - if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) { | |
1117 | - reiserfs_warning(p_s_sb, "clm-2076", | |
1118 | + if (continue_replay && bdev_read_only(sb->s_bdev)) { | |
1119 | + reiserfs_warning(sb, "clm-2076", | |
1120 | "device is readonly, unable to replay log"); | |
1121 | return -1; | |
1122 | } | |
1123 | @@ -2433,17 +2433,17 @@ static int journal_read(struct super_blo | |
1124 | */ | |
1125 | while (continue_replay | |
1126 | && cur_dblock < | |
1127 | - (SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
1128 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb))) { | |
1129 | + (SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
1130 | + SB_ONDISK_JOURNAL_SIZE(sb))) { | |
1131 | /* Note that it is required for blocksize of primary fs device and journal | |
1132 | device to be the same */ | |
1133 | d_bh = | |
1134 | reiserfs_breada(journal->j_dev_bd, cur_dblock, | |
1135 | - p_s_sb->s_blocksize, | |
1136 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
1137 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb)); | |
1138 | + sb->s_blocksize, | |
1139 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
1140 | + SB_ONDISK_JOURNAL_SIZE(sb)); | |
1141 | ret = | |
1142 | - journal_transaction_is_valid(p_s_sb, d_bh, | |
1143 | + journal_transaction_is_valid(sb, d_bh, | |
1144 | &oldest_invalid_trans_id, | |
1145 | &newest_mount_id); | |
1146 | if (ret == 1) { | |
1147 | @@ -2452,26 +2452,26 @@ static int journal_read(struct super_blo | |
1148 | oldest_trans_id = get_desc_trans_id(desc); | |
1149 | oldest_start = d_bh->b_blocknr; | |
1150 | newest_mount_id = get_desc_mount_id(desc); | |
1151 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
1152 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
1153 | "journal-1179: Setting " | |
1154 | "oldest_start to offset %llu, trans_id %lu", | |
1155 | oldest_start - | |
1156 | SB_ONDISK_JOURNAL_1st_BLOCK | |
1157 | - (p_s_sb), oldest_trans_id); | |
1158 | + (sb), oldest_trans_id); | |
1159 | } else if (oldest_trans_id > get_desc_trans_id(desc)) { | |
1160 | /* one we just read was older */ | |
1161 | oldest_trans_id = get_desc_trans_id(desc); | |
1162 | oldest_start = d_bh->b_blocknr; | |
1163 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
1164 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
1165 | "journal-1180: Resetting " | |
1166 | "oldest_start to offset %lu, trans_id %lu", | |
1167 | oldest_start - | |
1168 | SB_ONDISK_JOURNAL_1st_BLOCK | |
1169 | - (p_s_sb), oldest_trans_id); | |
1170 | + (sb), oldest_trans_id); | |
1171 | } | |
1172 | if (newest_mount_id < get_desc_mount_id(desc)) { | |
1173 | newest_mount_id = get_desc_mount_id(desc); | |
1174 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
1175 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
1176 | "journal-1299: Setting " | |
1177 | "newest_mount_id to %d", | |
1178 | get_desc_mount_id(desc)); | |
1179 | @@ -2486,17 +2486,17 @@ static int journal_read(struct super_blo | |
1180 | start_log_replay: | |
1181 | cur_dblock = oldest_start; | |
1182 | if (oldest_trans_id) { | |
1183 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
1184 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
1185 | "journal-1206: Starting replay " | |
1186 | "from offset %llu, trans_id %lu", | |
1187 | - cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), | |
1188 | + cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb), | |
1189 | oldest_trans_id); | |
1190 | ||
1191 | } | |
1192 | replay_count = 0; | |
1193 | while (continue_replay && oldest_trans_id > 0) { | |
1194 | ret = | |
1195 | - journal_read_transaction(p_s_sb, cur_dblock, oldest_start, | |
1196 | + journal_read_transaction(sb, cur_dblock, oldest_start, | |
1197 | oldest_trans_id, newest_mount_id); | |
1198 | if (ret < 0) { | |
1199 | return ret; | |
1200 | @@ -2504,14 +2504,14 @@ static int journal_read(struct super_blo | |
1201 | break; | |
1202 | } | |
1203 | cur_dblock = | |
1204 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + journal->j_start; | |
1205 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + journal->j_start; | |
1206 | replay_count++; | |
1207 | if (cur_dblock == oldest_start) | |
1208 | break; | |
1209 | } | |
1210 | ||
1211 | if (oldest_trans_id == 0) { | |
1212 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
1213 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
1214 | "journal-1225: No valid " "transactions found"); | |
1215 | } | |
1216 | /* j_start does not get set correctly if we don't replay any transactions. | |
1217 | @@ -2531,16 +2531,16 @@ static int journal_read(struct super_blo | |
1218 | } else { | |
1219 | journal->j_mount_id = newest_mount_id + 1; | |
1220 | } | |
1221 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1299: Setting " | |
1222 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1299: Setting " | |
1223 | "newest_mount_id to %lu", journal->j_mount_id); | |
1224 | journal->j_first_unflushed_offset = journal->j_start; | |
1225 | if (replay_count > 0) { | |
1226 | - reiserfs_info(p_s_sb, | |
1227 | + reiserfs_info(sb, | |
1228 | "replayed %d transactions in %lu seconds\n", | |
1229 | replay_count, get_seconds() - start); | |
1230 | } | |
1231 | - if (!bdev_read_only(p_s_sb->s_bdev) && | |
1232 | - _update_journal_header_block(p_s_sb, journal->j_start, | |
1233 | + if (!bdev_read_only(sb->s_bdev) && | |
1234 | + _update_journal_header_block(sb, journal->j_start, | |
1235 | journal->j_last_flush_trans_id)) { | |
1236 | /* replay failed, caller must call free_journal_ram and abort | |
1237 | ** the mount | |
1238 | @@ -2565,9 +2565,9 @@ static struct reiserfs_journal_list *all | |
1239 | return jl; | |
1240 | } | |
1241 | ||
1242 | -static void journal_list_init(struct super_block *p_s_sb) | |
1243 | +static void journal_list_init(struct super_block *sb) | |
1244 | { | |
1245 | - SB_JOURNAL(p_s_sb)->j_current_jl = alloc_journal_list(p_s_sb); | |
1246 | + SB_JOURNAL(sb)->j_current_jl = alloc_journal_list(sb); | |
1247 | } | |
1248 | ||
1249 | static int release_journal_dev(struct super_block *super, | |
1250 | @@ -2663,28 +2663,28 @@ static int journal_init_dev(struct super | |
1251 | */ | |
1252 | #define REISERFS_STANDARD_BLKSIZE (4096) | |
1253 | ||
1254 | -static int check_advise_trans_params(struct super_block *p_s_sb, | |
1255 | +static int check_advise_trans_params(struct super_block *sb, | |
1256 | struct reiserfs_journal *journal) | |
1257 | { | |
1258 | if (journal->j_trans_max) { | |
1259 | /* Non-default journal params. | |
1260 | Do sanity check for them. */ | |
1261 | int ratio = 1; | |
1262 | - if (p_s_sb->s_blocksize < REISERFS_STANDARD_BLKSIZE) | |
1263 | - ratio = REISERFS_STANDARD_BLKSIZE / p_s_sb->s_blocksize; | |
1264 | + if (sb->s_blocksize < REISERFS_STANDARD_BLKSIZE) | |
1265 | + ratio = REISERFS_STANDARD_BLKSIZE / sb->s_blocksize; | |
1266 | ||
1267 | if (journal->j_trans_max > JOURNAL_TRANS_MAX_DEFAULT / ratio || | |
1268 | journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio || | |
1269 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max < | |
1270 | + SB_ONDISK_JOURNAL_SIZE(sb) / journal->j_trans_max < | |
1271 | JOURNAL_MIN_RATIO) { | |
1272 | - reiserfs_warning(p_s_sb, "sh-462", | |
1273 | + reiserfs_warning(sb, "sh-462", | |
1274 | "bad transaction max size (%u). " | |
1275 | "FSCK?", journal->j_trans_max); | |
1276 | return 1; | |
1277 | } | |
1278 | if (journal->j_max_batch != (journal->j_trans_max) * | |
1279 | JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) { | |
1280 | - reiserfs_warning(p_s_sb, "sh-463", | |
1281 | + reiserfs_warning(sb, "sh-463", | |
1282 | "bad transaction max batch (%u). " | |
1283 | "FSCK?", journal->j_max_batch); | |
1284 | return 1; | |
1285 | @@ -2694,9 +2694,9 @@ static int check_advise_trans_params(str | |
1286 | The file system was created by old version | |
1287 | of mkreiserfs, so some fields contain zeros, | |
1288 | and we need to advise proper values for them */ | |
1289 | - if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) { | |
1290 | - reiserfs_warning(p_s_sb, "sh-464", "bad blocksize (%u)", | |
1291 | - p_s_sb->s_blocksize); | |
1292 | + if (sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) { | |
1293 | + reiserfs_warning(sb, "sh-464", "bad blocksize (%u)", | |
1294 | + sb->s_blocksize); | |
1295 | return 1; | |
1296 | } | |
1297 | journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT; | |
1298 | @@ -2709,10 +2709,10 @@ static int check_advise_trans_params(str | |
1299 | /* | |
1300 | ** must be called once on fs mount. calls journal_read for you | |
1301 | */ | |
1302 | -int journal_init(struct super_block *p_s_sb, const char *j_dev_name, | |
1303 | +int journal_init(struct super_block *sb, const char *j_dev_name, | |
1304 | int old_format, unsigned int commit_max_age) | |
1305 | { | |
1306 | - int num_cnodes = SB_ONDISK_JOURNAL_SIZE(p_s_sb) * 2; | |
1307 | + int num_cnodes = SB_ONDISK_JOURNAL_SIZE(sb) * 2; | |
1308 | struct buffer_head *bhjh; | |
1309 | struct reiserfs_super_block *rs; | |
1310 | struct reiserfs_journal_header *jh; | |
1311 | @@ -2720,9 +2720,9 @@ int journal_init(struct super_block *p_s | |
1312 | struct reiserfs_journal_list *jl; | |
1313 | char b[BDEVNAME_SIZE]; | |
1314 | ||
1315 | - journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal)); | |
1316 | + journal = SB_JOURNAL(sb) = vmalloc(sizeof(struct reiserfs_journal)); | |
1317 | if (!journal) { | |
1318 | - reiserfs_warning(p_s_sb, "journal-1256", | |
1319 | + reiserfs_warning(sb, "journal-1256", | |
1320 | "unable to get memory for journal structure"); | |
1321 | return 1; | |
1322 | } | |
1323 | @@ -2732,50 +2732,50 @@ int journal_init(struct super_block *p_s | |
1324 | INIT_LIST_HEAD(&journal->j_working_list); | |
1325 | INIT_LIST_HEAD(&journal->j_journal_list); | |
1326 | journal->j_persistent_trans = 0; | |
1327 | - if (reiserfs_allocate_list_bitmaps(p_s_sb, | |
1328 | + if (reiserfs_allocate_list_bitmaps(sb, | |
1329 | journal->j_list_bitmap, | |
1330 | - reiserfs_bmap_count(p_s_sb))) | |
1331 | + reiserfs_bmap_count(sb))) | |
1332 | goto free_and_return; | |
1333 | - allocate_bitmap_nodes(p_s_sb); | |
1334 | + allocate_bitmap_nodes(sb); | |
1335 | ||
1336 | /* reserved for journal area support */ | |
1337 | - SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) = (old_format ? | |
1338 | + SB_JOURNAL_1st_RESERVED_BLOCK(sb) = (old_format ? | |
1339 | REISERFS_OLD_DISK_OFFSET_IN_BYTES | |
1340 | - / p_s_sb->s_blocksize + | |
1341 | - reiserfs_bmap_count(p_s_sb) + | |
1342 | + / sb->s_blocksize + | |
1343 | + reiserfs_bmap_count(sb) + | |
1344 | 1 : | |
1345 | REISERFS_DISK_OFFSET_IN_BYTES / | |
1346 | - p_s_sb->s_blocksize + 2); | |
1347 | + sb->s_blocksize + 2); | |
1348 | ||
1349 | /* Sanity check to see is the standard journal fitting withing first bitmap | |
1350 | (actual for small blocksizes) */ | |
1351 | - if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) && | |
1352 | - (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + | |
1353 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) { | |
1354 | - reiserfs_warning(p_s_sb, "journal-1393", | |
1355 | + if (!SB_ONDISK_JOURNAL_DEVICE(sb) && | |
1356 | + (SB_JOURNAL_1st_RESERVED_BLOCK(sb) + | |
1357 | + SB_ONDISK_JOURNAL_SIZE(sb) > sb->s_blocksize * 8)) { | |
1358 | + reiserfs_warning(sb, "journal-1393", | |
1359 | "journal does not fit for area addressed " | |
1360 | "by first of bitmap blocks. It starts at " | |
1361 | "%u and its size is %u. Block size %ld", | |
1362 | - SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), | |
1363 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb), | |
1364 | - p_s_sb->s_blocksize); | |
1365 | + SB_JOURNAL_1st_RESERVED_BLOCK(sb), | |
1366 | + SB_ONDISK_JOURNAL_SIZE(sb), | |
1367 | + sb->s_blocksize); | |
1368 | goto free_and_return; | |
1369 | } | |
1370 | ||
1371 | - if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) { | |
1372 | - reiserfs_warning(p_s_sb, "sh-462", | |
1373 | + if (journal_init_dev(sb, journal, j_dev_name) != 0) { | |
1374 | + reiserfs_warning(sb, "sh-462", | |
1375 | "unable to initialize jornal device"); | |
1376 | goto free_and_return; | |
1377 | } | |
1378 | ||
1379 | - rs = SB_DISK_SUPER_BLOCK(p_s_sb); | |
1380 | + rs = SB_DISK_SUPER_BLOCK(sb); | |
1381 | ||
1382 | /* read journal header */ | |
1383 | - bhjh = journal_bread(p_s_sb, | |
1384 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
1385 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb)); | |
1386 | + bhjh = journal_bread(sb, | |
1387 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
1388 | + SB_ONDISK_JOURNAL_SIZE(sb)); | |
1389 | if (!bhjh) { | |
1390 | - reiserfs_warning(p_s_sb, "sh-459", | |
1391 | + reiserfs_warning(sb, "sh-459", | |
1392 | "unable to read journal header"); | |
1393 | goto free_and_return; | |
1394 | } | |
1395 | @@ -2785,7 +2785,7 @@ int journal_init(struct super_block *p_s | |
1396 | if (is_reiserfs_jr(rs) | |
1397 | && (le32_to_cpu(jh->jh_journal.jp_journal_magic) != | |
1398 | sb_jp_journal_magic(rs))) { | |
1399 | - reiserfs_warning(p_s_sb, "sh-460", | |
1400 | + reiserfs_warning(sb, "sh-460", | |
1401 | "journal header magic %x (device %s) does " | |
1402 | "not match to magic found in super block %x", | |
1403 | jh->jh_journal.jp_journal_magic, | |
1404 | @@ -2801,7 +2801,7 @@ int journal_init(struct super_block *p_s | |
1405 | le32_to_cpu(jh->jh_journal.jp_journal_max_commit_age); | |
1406 | journal->j_max_trans_age = JOURNAL_MAX_TRANS_AGE; | |
1407 | ||
1408 | - if (check_advise_trans_params(p_s_sb, journal) != 0) | |
1409 | + if (check_advise_trans_params(sb, journal) != 0) | |
1410 | goto free_and_return; | |
1411 | journal->j_default_max_commit_age = journal->j_max_commit_age; | |
1412 | ||
1413 | @@ -2810,12 +2810,12 @@ int journal_init(struct super_block *p_s | |
1414 | journal->j_max_trans_age = commit_max_age; | |
1415 | } | |
1416 | ||
1417 | - reiserfs_info(p_s_sb, "journal params: device %s, size %u, " | |
1418 | + reiserfs_info(sb, "journal params: device %s, size %u, " | |
1419 | "journal first block %u, max trans len %u, max batch %u, " | |
1420 | "max commit age %u, max trans age %u\n", | |
1421 | bdevname(journal->j_dev_bd, b), | |
1422 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb), | |
1423 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), | |
1424 | + SB_ONDISK_JOURNAL_SIZE(sb), | |
1425 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb), | |
1426 | journal->j_trans_max, | |
1427 | journal->j_max_batch, | |
1428 | journal->j_max_commit_age, journal->j_max_trans_age); | |
1429 | @@ -2823,7 +2823,7 @@ int journal_init(struct super_block *p_s | |
1430 | brelse(bhjh); | |
1431 | ||
1432 | journal->j_list_bitmap_index = 0; | |
1433 | - journal_list_init(p_s_sb); | |
1434 | + journal_list_init(sb); | |
1435 | ||
1436 | memset(journal->j_list_hash_table, 0, | |
1437 | JOURNAL_HASH_SIZE * sizeof(struct reiserfs_journal_cnode *)); | |
1438 | @@ -2855,7 +2855,7 @@ int journal_init(struct super_block *p_s | |
1439 | journal->j_must_wait = 0; | |
1440 | ||
1441 | if (journal->j_cnode_free == 0) { | |
1442 | - reiserfs_warning(p_s_sb, "journal-2004", "Journal cnode memory " | |
1443 | + reiserfs_warning(sb, "journal-2004", "Journal cnode memory " | |
1444 | "allocation failed (%ld bytes). Journal is " | |
1445 | "too large for available memory. Usually " | |
1446 | "this is due to a journal that is too large.", | |
1447 | @@ -2863,16 +2863,16 @@ int journal_init(struct super_block *p_s | |
1448 | goto free_and_return; | |
1449 | } | |
1450 | ||
1451 | - init_journal_hash(p_s_sb); | |
1452 | + init_journal_hash(sb); | |
1453 | jl = journal->j_current_jl; | |
1454 | - jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); | |
1455 | + jl->j_list_bitmap = get_list_bitmap(sb, jl); | |
1456 | if (!jl->j_list_bitmap) { | |
1457 | - reiserfs_warning(p_s_sb, "journal-2005", | |
1458 | + reiserfs_warning(sb, "journal-2005", | |
1459 | "get_list_bitmap failed for journal list 0"); | |
1460 | goto free_and_return; | |
1461 | } | |
1462 | - if (journal_read(p_s_sb) < 0) { | |
1463 | - reiserfs_warning(p_s_sb, "reiserfs-2006", | |
1464 | + if (journal_read(sb) < 0) { | |
1465 | + reiserfs_warning(sb, "reiserfs-2006", | |
1466 | "Replay Failure, unable to mount"); | |
1467 | goto free_and_return; | |
1468 | } | |
1469 | @@ -2882,10 +2882,10 @@ int journal_init(struct super_block *p_s | |
1470 | commit_wq = create_workqueue("reiserfs"); | |
1471 | ||
1472 | INIT_DELAYED_WORK(&journal->j_work, flush_async_commits); | |
1473 | - journal->j_work_sb = p_s_sb; | |
1474 | + journal->j_work_sb = sb; | |
1475 | return 0; | |
1476 | free_and_return: | |
1477 | - free_journal_ram(p_s_sb); | |
1478 | + free_journal_ram(sb); | |
1479 | return 1; | |
1480 | } | |
1481 | ||
1482 | @@ -3001,37 +3001,37 @@ static void let_transaction_grow(struct | |
1483 | ** expect to use in nblocks. | |
1484 | */ | |
1485 | static int do_journal_begin_r(struct reiserfs_transaction_handle *th, | |
1486 | - struct super_block *p_s_sb, unsigned long nblocks, | |
1487 | + struct super_block *sb, unsigned long nblocks, | |
1488 | int join) | |
1489 | { | |
1490 | time_t now = get_seconds(); | |
1491 | unsigned int old_trans_id; | |
1492 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1493 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1494 | struct reiserfs_transaction_handle myth; | |
1495 | int sched_count = 0; | |
1496 | int retval; | |
1497 | ||
1498 | - reiserfs_check_lock_depth(p_s_sb, "journal_begin"); | |
1499 | + reiserfs_check_lock_depth(sb, "journal_begin"); | |
1500 | BUG_ON(nblocks > journal->j_trans_max); | |
1501 | ||
1502 | - PROC_INFO_INC(p_s_sb, journal.journal_being); | |
1503 | + PROC_INFO_INC(sb, journal.journal_being); | |
1504 | /* set here for journal_join */ | |
1505 | th->t_refcount = 1; | |
1506 | - th->t_super = p_s_sb; | |
1507 | + th->t_super = sb; | |
1508 | ||
1509 | relock: | |
1510 | - lock_journal(p_s_sb); | |
1511 | + lock_journal(sb); | |
1512 | if (join != JBEGIN_ABORT && reiserfs_is_journal_aborted(journal)) { | |
1513 | - unlock_journal(p_s_sb); | |
1514 | + unlock_journal(sb); | |
1515 | retval = journal->j_errno; | |
1516 | goto out_fail; | |
1517 | } | |
1518 | journal->j_bcount++; | |
1519 | ||
1520 | if (test_bit(J_WRITERS_BLOCKED, &journal->j_state)) { | |
1521 | - unlock_journal(p_s_sb); | |
1522 | - reiserfs_wait_on_write_block(p_s_sb); | |
1523 | - PROC_INFO_INC(p_s_sb, journal.journal_relock_writers); | |
1524 | + unlock_journal(sb); | |
1525 | + reiserfs_wait_on_write_block(sb); | |
1526 | + PROC_INFO_INC(sb, journal.journal_relock_writers); | |
1527 | goto relock; | |
1528 | } | |
1529 | now = get_seconds(); | |
1530 | @@ -3052,7 +3052,7 @@ static int do_journal_begin_r(struct rei | |
1531 | || (!join && journal->j_cnode_free < (journal->j_trans_max * 3))) { | |
1532 | ||
1533 | old_trans_id = journal->j_trans_id; | |
1534 | - unlock_journal(p_s_sb); /* allow others to finish this transaction */ | |
1535 | + unlock_journal(sb); /* allow others to finish this transaction */ | |
1536 | ||
1537 | if (!join && (journal->j_len_alloc + nblocks + 2) >= | |
1538 | journal->j_max_batch && | |
1539 | @@ -3060,7 +3060,7 @@ static int do_journal_begin_r(struct rei | |
1540 | (journal->j_len_alloc * 75)) { | |
1541 | if (atomic_read(&journal->j_wcount) > 10) { | |
1542 | sched_count++; | |
1543 | - queue_log_writer(p_s_sb); | |
1544 | + queue_log_writer(sb); | |
1545 | goto relock; | |
1546 | } | |
1547 | } | |
1548 | @@ -3070,25 +3070,25 @@ static int do_journal_begin_r(struct rei | |
1549 | if (atomic_read(&journal->j_jlock)) { | |
1550 | while (journal->j_trans_id == old_trans_id && | |
1551 | atomic_read(&journal->j_jlock)) { | |
1552 | - queue_log_writer(p_s_sb); | |
1553 | + queue_log_writer(sb); | |
1554 | } | |
1555 | goto relock; | |
1556 | } | |
1557 | - retval = journal_join(&myth, p_s_sb, 1); | |
1558 | + retval = journal_join(&myth, sb, 1); | |
1559 | if (retval) | |
1560 | goto out_fail; | |
1561 | ||
1562 | /* someone might have ended the transaction while we joined */ | |
1563 | if (old_trans_id != journal->j_trans_id) { | |
1564 | - retval = do_journal_end(&myth, p_s_sb, 1, 0); | |
1565 | + retval = do_journal_end(&myth, sb, 1, 0); | |
1566 | } else { | |
1567 | - retval = do_journal_end(&myth, p_s_sb, 1, COMMIT_NOW); | |
1568 | + retval = do_journal_end(&myth, sb, 1, COMMIT_NOW); | |
1569 | } | |
1570 | ||
1571 | if (retval) | |
1572 | goto out_fail; | |
1573 | ||
1574 | - PROC_INFO_INC(p_s_sb, journal.journal_relock_wcount); | |
1575 | + PROC_INFO_INC(sb, journal.journal_relock_wcount); | |
1576 | goto relock; | |
1577 | } | |
1578 | /* we are the first writer, set trans_id */ | |
1579 | @@ -3100,7 +3100,7 @@ static int do_journal_begin_r(struct rei | |
1580 | th->t_blocks_logged = 0; | |
1581 | th->t_blocks_allocated = nblocks; | |
1582 | th->t_trans_id = journal->j_trans_id; | |
1583 | - unlock_journal(p_s_sb); | |
1584 | + unlock_journal(sb); | |
1585 | INIT_LIST_HEAD(&th->t_list); | |
1586 | get_fs_excl(); | |
1587 | return 0; | |
1588 | @@ -3110,7 +3110,7 @@ static int do_journal_begin_r(struct rei | |
1589 | /* Re-set th->t_super, so we can properly keep track of how many | |
1590 | * persistent transactions there are. We need to do this so if this | |
1591 | * call is part of a failed restart_transaction, we can free it later */ | |
1592 | - th->t_super = p_s_sb; | |
1593 | + th->t_super = sb; | |
1594 | return retval; | |
1595 | } | |
1596 | ||
1597 | @@ -3161,7 +3161,7 @@ int reiserfs_end_persistent_transaction( | |
1598 | } | |
1599 | ||
1600 | static int journal_join(struct reiserfs_transaction_handle *th, | |
1601 | - struct super_block *p_s_sb, unsigned long nblocks) | |
1602 | + struct super_block *sb, unsigned long nblocks) | |
1603 | { | |
1604 | struct reiserfs_transaction_handle *cur_th = current->journal_info; | |
1605 | ||
1606 | @@ -3170,11 +3170,11 @@ static int journal_join(struct reiserfs_ | |
1607 | */ | |
1608 | th->t_handle_save = cur_th; | |
1609 | BUG_ON(cur_th && cur_th->t_refcount > 1); | |
1610 | - return do_journal_begin_r(th, p_s_sb, nblocks, JBEGIN_JOIN); | |
1611 | + return do_journal_begin_r(th, sb, nblocks, JBEGIN_JOIN); | |
1612 | } | |
1613 | ||
1614 | int journal_join_abort(struct reiserfs_transaction_handle *th, | |
1615 | - struct super_block *p_s_sb, unsigned long nblocks) | |
1616 | + struct super_block *sb, unsigned long nblocks) | |
1617 | { | |
1618 | struct reiserfs_transaction_handle *cur_th = current->journal_info; | |
1619 | ||
1620 | @@ -3183,11 +3183,11 @@ int journal_join_abort(struct reiserfs_t | |
1621 | */ | |
1622 | th->t_handle_save = cur_th; | |
1623 | BUG_ON(cur_th && cur_th->t_refcount > 1); | |
1624 | - return do_journal_begin_r(th, p_s_sb, nblocks, JBEGIN_ABORT); | |
1625 | + return do_journal_begin_r(th, sb, nblocks, JBEGIN_ABORT); | |
1626 | } | |
1627 | ||
1628 | int journal_begin(struct reiserfs_transaction_handle *th, | |
1629 | - struct super_block *p_s_sb, unsigned long nblocks) | |
1630 | + struct super_block *sb, unsigned long nblocks) | |
1631 | { | |
1632 | struct reiserfs_transaction_handle *cur_th = current->journal_info; | |
1633 | int ret; | |
1634 | @@ -3195,12 +3195,12 @@ int journal_begin(struct reiserfs_transa | |
1635 | th->t_handle_save = NULL; | |
1636 | if (cur_th) { | |
1637 | /* we are nesting into the current transaction */ | |
1638 | - if (cur_th->t_super == p_s_sb) { | |
1639 | + if (cur_th->t_super == sb) { | |
1640 | BUG_ON(!cur_th->t_refcount); | |
1641 | cur_th->t_refcount++; | |
1642 | memcpy(th, cur_th, sizeof(*th)); | |
1643 | if (th->t_refcount <= 1) | |
1644 | - reiserfs_warning(p_s_sb, "reiserfs-2005", | |
1645 | + reiserfs_warning(sb, "reiserfs-2005", | |
1646 | "BAD: refcount <= 1, but " | |
1647 | "journal_info != 0"); | |
1648 | return 0; | |
1649 | @@ -3209,7 +3209,7 @@ int journal_begin(struct reiserfs_transa | |
1650 | ** save it and restore on journal_end. This should never | |
1651 | ** really happen... | |
1652 | */ | |
1653 | - reiserfs_warning(p_s_sb, "clm-2100", | |
1654 | + reiserfs_warning(sb, "clm-2100", | |
1655 | "nesting info a different FS"); | |
1656 | th->t_handle_save = current->journal_info; | |
1657 | current->journal_info = th; | |
1658 | @@ -3217,7 +3217,7 @@ int journal_begin(struct reiserfs_transa | |
1659 | } else { | |
1660 | current->journal_info = th; | |
1661 | } | |
1662 | - ret = do_journal_begin_r(th, p_s_sb, nblocks, JBEGIN_REG); | |
1663 | + ret = do_journal_begin_r(th, sb, nblocks, JBEGIN_REG); | |
1664 | BUG_ON(current->journal_info != th); | |
1665 | ||
1666 | /* I guess this boils down to being the reciprocal of clm-2100 above. | |
1667 | @@ -3241,28 +3241,28 @@ int journal_begin(struct reiserfs_transa | |
1668 | ** if j_len, is bigger than j_len_alloc, it pushes j_len_alloc to 10 + j_len. | |
1669 | */ | |
1670 | int journal_mark_dirty(struct reiserfs_transaction_handle *th, | |
1671 | - struct super_block *p_s_sb, struct buffer_head *bh) | |
1672 | + struct super_block *sb, struct buffer_head *bh) | |
1673 | { | |
1674 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1675 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1676 | struct reiserfs_journal_cnode *cn = NULL; | |
1677 | int count_already_incd = 0; | |
1678 | int prepared = 0; | |
1679 | BUG_ON(!th->t_trans_id); | |
1680 | ||
1681 | - PROC_INFO_INC(p_s_sb, journal.mark_dirty); | |
1682 | + PROC_INFO_INC(sb, journal.mark_dirty); | |
1683 | if (th->t_trans_id != journal->j_trans_id) { | |
1684 | reiserfs_panic(th->t_super, "journal-1577", | |
1685 | "handle trans id %ld != current trans id %ld", | |
1686 | th->t_trans_id, journal->j_trans_id); | |
1687 | } | |
1688 | ||
1689 | - p_s_sb->s_dirt = 1; | |
1690 | + sb->s_dirt = 1; | |
1691 | ||
1692 | prepared = test_clear_buffer_journal_prepared(bh); | |
1693 | clear_buffer_journal_restore_dirty(bh); | |
1694 | /* already in this transaction, we are done */ | |
1695 | if (buffer_journaled(bh)) { | |
1696 | - PROC_INFO_INC(p_s_sb, journal.mark_dirty_already); | |
1697 | + PROC_INFO_INC(sb, journal.mark_dirty_already); | |
1698 | return 0; | |
1699 | } | |
1700 | ||
1701 | @@ -3271,7 +3271,7 @@ int journal_mark_dirty(struct reiserfs_t | |
1702 | ** could get to disk too early. NOT GOOD. | |
1703 | */ | |
1704 | if (!prepared || buffer_dirty(bh)) { | |
1705 | - reiserfs_warning(p_s_sb, "journal-1777", | |
1706 | + reiserfs_warning(sb, "journal-1777", | |
1707 | "buffer %llu bad state " | |
1708 | "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT", | |
1709 | (unsigned long long)bh->b_blocknr, | |
1710 | @@ -3282,7 +3282,7 @@ int journal_mark_dirty(struct reiserfs_t | |
1711 | } | |
1712 | ||
1713 | if (atomic_read(&(journal->j_wcount)) <= 0) { | |
1714 | - reiserfs_warning(p_s_sb, "journal-1409", | |
1715 | + reiserfs_warning(sb, "journal-1409", | |
1716 | "returning because j_wcount was %d", | |
1717 | atomic_read(&(journal->j_wcount))); | |
1718 | return 1; | |
1719 | @@ -3298,7 +3298,7 @@ int journal_mark_dirty(struct reiserfs_t | |
1720 | ||
1721 | if (buffer_journal_dirty(bh)) { | |
1722 | count_already_incd = 1; | |
1723 | - PROC_INFO_INC(p_s_sb, journal.mark_dirty_notjournal); | |
1724 | + PROC_INFO_INC(sb, journal.mark_dirty_notjournal); | |
1725 | clear_buffer_journal_dirty(bh); | |
1726 | } | |
1727 | ||
1728 | @@ -3310,10 +3310,9 @@ int journal_mark_dirty(struct reiserfs_t | |
1729 | ||
1730 | /* now put this guy on the end */ | |
1731 | if (!cn) { | |
1732 | - cn = get_cnode(p_s_sb); | |
1733 | + cn = get_cnode(sb); | |
1734 | if (!cn) { | |
1735 | - reiserfs_panic(p_s_sb, "journal-4", | |
1736 | - "get_cnode failed!"); | |
1737 | + reiserfs_panic(sb, "journal-4", "get_cnode failed!"); | |
1738 | } | |
1739 | ||
1740 | if (th->t_blocks_logged == th->t_blocks_allocated) { | |
1741 | @@ -3325,7 +3324,7 @@ int journal_mark_dirty(struct reiserfs_t | |
1742 | ||
1743 | cn->bh = bh; | |
1744 | cn->blocknr = bh->b_blocknr; | |
1745 | - cn->sb = p_s_sb; | |
1746 | + cn->sb = sb; | |
1747 | cn->jlist = NULL; | |
1748 | insert_journal_hash(journal->j_hash_table, cn); | |
1749 | if (!count_already_incd) { | |
1750 | @@ -3346,10 +3345,10 @@ int journal_mark_dirty(struct reiserfs_t | |
1751 | } | |
1752 | ||
1753 | int journal_end(struct reiserfs_transaction_handle *th, | |
1754 | - struct super_block *p_s_sb, unsigned long nblocks) | |
1755 | + struct super_block *sb, unsigned long nblocks) | |
1756 | { | |
1757 | if (!current->journal_info && th->t_refcount > 1) | |
1758 | - reiserfs_warning(p_s_sb, "REISER-NESTING", | |
1759 | + reiserfs_warning(sb, "REISER-NESTING", | |
1760 | "th NULL, refcount %d", th->t_refcount); | |
1761 | ||
1762 | if (!th->t_trans_id) { | |
1763 | @@ -3373,7 +3372,7 @@ int journal_end(struct reiserfs_transact | |
1764 | } | |
1765 | return 0; | |
1766 | } else { | |
1767 | - return do_journal_end(th, p_s_sb, nblocks, 0); | |
1768 | + return do_journal_end(th, sb, nblocks, 0); | |
1769 | } | |
1770 | } | |
1771 | ||
1772 | @@ -3384,15 +3383,15 @@ int journal_end(struct reiserfs_transact | |
1773 | ** | |
1774 | ** returns 1 if it cleaned and relsed the buffer. 0 otherwise | |
1775 | */ | |
1776 | -static int remove_from_transaction(struct super_block *p_s_sb, | |
1777 | +static int remove_from_transaction(struct super_block *sb, | |
1778 | b_blocknr_t blocknr, int already_cleaned) | |
1779 | { | |
1780 | struct buffer_head *bh; | |
1781 | struct reiserfs_journal_cnode *cn; | |
1782 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1783 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1784 | int ret = 0; | |
1785 | ||
1786 | - cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, blocknr); | |
1787 | + cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr); | |
1788 | if (!cn || !cn->bh) { | |
1789 | return ret; | |
1790 | } | |
1791 | @@ -3410,7 +3409,7 @@ static int remove_from_transaction(struc | |
1792 | journal->j_last = cn->prev; | |
1793 | } | |
1794 | if (bh) | |
1795 | - remove_journal_hash(p_s_sb, journal->j_hash_table, NULL, | |
1796 | + remove_journal_hash(sb, journal->j_hash_table, NULL, | |
1797 | bh->b_blocknr, 0); | |
1798 | clear_buffer_journaled(bh); /* don't log this one */ | |
1799 | ||
1800 | @@ -3420,14 +3419,14 @@ static int remove_from_transaction(struc | |
1801 | clear_buffer_journal_test(bh); | |
1802 | put_bh(bh); | |
1803 | if (atomic_read(&(bh->b_count)) < 0) { | |
1804 | - reiserfs_warning(p_s_sb, "journal-1752", | |
1805 | + reiserfs_warning(sb, "journal-1752", | |
1806 | "b_count < 0"); | |
1807 | } | |
1808 | ret = 1; | |
1809 | } | |
1810 | journal->j_len--; | |
1811 | journal->j_len_alloc--; | |
1812 | - free_cnode(p_s_sb, cn); | |
1813 | + free_cnode(sb, cn); | |
1814 | return ret; | |
1815 | } | |
1816 | ||
1817 | @@ -3478,19 +3477,19 @@ static int can_dirty(struct reiserfs_jou | |
1818 | ** will wait until the current transaction is done/committed before returning | |
1819 | */ | |
1820 | int journal_end_sync(struct reiserfs_transaction_handle *th, | |
1821 | - struct super_block *p_s_sb, unsigned long nblocks) | |
1822 | + struct super_block *sb, unsigned long nblocks) | |
1823 | { | |
1824 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1825 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1826 | ||
1827 | BUG_ON(!th->t_trans_id); | |
1828 | /* you can sync while nested, very, very bad */ | |
1829 | BUG_ON(th->t_refcount > 1); | |
1830 | if (journal->j_len == 0) { | |
1831 | - reiserfs_prepare_for_journal(p_s_sb, SB_BUFFER_WITH_SB(p_s_sb), | |
1832 | + reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb), | |
1833 | 1); | |
1834 | - journal_mark_dirty(th, p_s_sb, SB_BUFFER_WITH_SB(p_s_sb)); | |
1835 | + journal_mark_dirty(th, sb, SB_BUFFER_WITH_SB(sb)); | |
1836 | } | |
1837 | - return do_journal_end(th, p_s_sb, nblocks, COMMIT_NOW | WAIT); | |
1838 | + return do_journal_end(th, sb, nblocks, COMMIT_NOW | WAIT); | |
1839 | } | |
1840 | ||
1841 | /* | |
1842 | @@ -3500,7 +3499,7 @@ static void flush_async_commits(struct w | |
1843 | { | |
1844 | struct reiserfs_journal *journal = | |
1845 | container_of(work, struct reiserfs_journal, j_work.work); | |
1846 | - struct super_block *p_s_sb = journal->j_work_sb; | |
1847 | + struct super_block *sb = journal->j_work_sb; | |
1848 | struct reiserfs_journal_list *jl; | |
1849 | struct list_head *entry; | |
1850 | ||
1851 | @@ -3509,7 +3508,7 @@ static void flush_async_commits(struct w | |
1852 | /* last entry is the youngest, commit it and you get everything */ | |
1853 | entry = journal->j_journal_list.prev; | |
1854 | jl = JOURNAL_LIST_ENTRY(entry); | |
1855 | - flush_commit_list(p_s_sb, jl, 1); | |
1856 | + flush_commit_list(sb, jl, 1); | |
1857 | } | |
1858 | unlock_kernel(); | |
1859 | } | |
1860 | @@ -3518,11 +3517,11 @@ static void flush_async_commits(struct w | |
1861 | ** flushes any old transactions to disk | |
1862 | ** ends the current transaction if it is too old | |
1863 | */ | |
1864 | -int reiserfs_flush_old_commits(struct super_block *p_s_sb) | |
1865 | +int reiserfs_flush_old_commits(struct super_block *sb) | |
1866 | { | |
1867 | time_t now; | |
1868 | struct reiserfs_transaction_handle th; | |
1869 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1870 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1871 | ||
1872 | now = get_seconds(); | |
1873 | /* safety check so we don't flush while we are replaying the log during | |
1874 | @@ -3539,20 +3538,20 @@ int reiserfs_flush_old_commits(struct su | |
1875 | journal->j_trans_start_time > 0 && | |
1876 | journal->j_len > 0 && | |
1877 | (now - journal->j_trans_start_time) > journal->j_max_trans_age) { | |
1878 | - if (!journal_join(&th, p_s_sb, 1)) { | |
1879 | - reiserfs_prepare_for_journal(p_s_sb, | |
1880 | - SB_BUFFER_WITH_SB(p_s_sb), | |
1881 | + if (!journal_join(&th, sb, 1)) { | |
1882 | + reiserfs_prepare_for_journal(sb, | |
1883 | + SB_BUFFER_WITH_SB(sb), | |
1884 | 1); | |
1885 | - journal_mark_dirty(&th, p_s_sb, | |
1886 | - SB_BUFFER_WITH_SB(p_s_sb)); | |
1887 | + journal_mark_dirty(&th, sb, | |
1888 | + SB_BUFFER_WITH_SB(sb)); | |
1889 | ||
1890 | /* we're only being called from kreiserfsd, it makes no sense to do | |
1891 | ** an async commit so that kreiserfsd can do it later | |
1892 | */ | |
1893 | - do_journal_end(&th, p_s_sb, 1, COMMIT_NOW | WAIT); | |
1894 | + do_journal_end(&th, sb, 1, COMMIT_NOW | WAIT); | |
1895 | } | |
1896 | } | |
1897 | - return p_s_sb->s_dirt; | |
1898 | + return sb->s_dirt; | |
1899 | } | |
1900 | ||
1901 | /* | |
1902 | @@ -3567,7 +3566,7 @@ int reiserfs_flush_old_commits(struct su | |
1903 | ** Note, we can't allow the journal_end to proceed while there are still writers in the log. | |
1904 | */ | |
1905 | static int check_journal_end(struct reiserfs_transaction_handle *th, | |
1906 | - struct super_block *p_s_sb, unsigned long nblocks, | |
1907 | + struct super_block *sb, unsigned long nblocks, | |
1908 | int flags) | |
1909 | { | |
1910 | ||
1911 | @@ -3576,7 +3575,7 @@ static int check_journal_end(struct reis | |
1912 | int commit_now = flags & COMMIT_NOW; | |
1913 | int wait_on_commit = flags & WAIT; | |
1914 | struct reiserfs_journal_list *jl; | |
1915 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1916 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1917 | ||
1918 | BUG_ON(!th->t_trans_id); | |
1919 | ||
1920 | @@ -3615,31 +3614,31 @@ static int check_journal_end(struct reis | |
1921 | if (flush) { | |
1922 | journal->j_next_full_flush = 1; | |
1923 | } | |
1924 | - unlock_journal(p_s_sb); | |
1925 | + unlock_journal(sb); | |
1926 | ||
1927 | /* sleep while the current transaction is still j_jlocked */ | |
1928 | while (journal->j_trans_id == trans_id) { | |
1929 | if (atomic_read(&journal->j_jlock)) { | |
1930 | - queue_log_writer(p_s_sb); | |
1931 | + queue_log_writer(sb); | |
1932 | } else { | |
1933 | - lock_journal(p_s_sb); | |
1934 | + lock_journal(sb); | |
1935 | if (journal->j_trans_id == trans_id) { | |
1936 | atomic_set(&(journal->j_jlock), | |
1937 | 1); | |
1938 | } | |
1939 | - unlock_journal(p_s_sb); | |
1940 | + unlock_journal(sb); | |
1941 | } | |
1942 | } | |
1943 | BUG_ON(journal->j_trans_id == trans_id); | |
1944 | ||
1945 | if (commit_now | |
1946 | - && journal_list_still_alive(p_s_sb, trans_id) | |
1947 | + && journal_list_still_alive(sb, trans_id) | |
1948 | && wait_on_commit) { | |
1949 | - flush_commit_list(p_s_sb, jl, 1); | |
1950 | + flush_commit_list(sb, jl, 1); | |
1951 | } | |
1952 | return 0; | |
1953 | } | |
1954 | - unlock_journal(p_s_sb); | |
1955 | + unlock_journal(sb); | |
1956 | return 0; | |
1957 | } | |
1958 | ||
1959 | @@ -3656,12 +3655,12 @@ static int check_journal_end(struct reis | |
1960 | && journal->j_len_alloc < journal->j_max_batch | |
1961 | && journal->j_cnode_free > (journal->j_trans_max * 3)) { | |
1962 | journal->j_bcount++; | |
1963 | - unlock_journal(p_s_sb); | |
1964 | + unlock_journal(sb); | |
1965 | return 0; | |
1966 | } | |
1967 | ||
1968 | - if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { | |
1969 | - reiserfs_panic(p_s_sb, "journal-003", | |
1970 | + if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(sb)) { | |
1971 | + reiserfs_panic(sb, "journal-003", | |
1972 | "j_start (%ld) is too high", | |
1973 | journal->j_start); | |
1974 | } | |
1975 | @@ -3683,16 +3682,16 @@ static int check_journal_end(struct reis | |
1976 | ** Then remove it from the current transaction, decrementing any counters and filing it on the clean list. | |
1977 | */ | |
1978 | int journal_mark_freed(struct reiserfs_transaction_handle *th, | |
1979 | - struct super_block *p_s_sb, b_blocknr_t blocknr) | |
1980 | + struct super_block *sb, b_blocknr_t blocknr) | |
1981 | { | |
1982 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
1983 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
1984 | struct reiserfs_journal_cnode *cn = NULL; | |
1985 | struct buffer_head *bh = NULL; | |
1986 | struct reiserfs_list_bitmap *jb = NULL; | |
1987 | int cleaned = 0; | |
1988 | BUG_ON(!th->t_trans_id); | |
1989 | ||
1990 | - cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, blocknr); | |
1991 | + cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr); | |
1992 | if (cn && cn->bh) { | |
1993 | bh = cn->bh; | |
1994 | get_bh(bh); | |
1995 | @@ -3702,15 +3701,15 @@ int journal_mark_freed(struct reiserfs_t | |
1996 | clear_buffer_journal_new(bh); | |
1997 | clear_prepared_bits(bh); | |
1998 | reiserfs_clean_and_file_buffer(bh); | |
1999 | - cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned); | |
2000 | + cleaned = remove_from_transaction(sb, blocknr, cleaned); | |
2001 | } else { | |
2002 | /* set the bit for this block in the journal bitmap for this transaction */ | |
2003 | jb = journal->j_current_jl->j_list_bitmap; | |
2004 | if (!jb) { | |
2005 | - reiserfs_panic(p_s_sb, "journal-1702", | |
2006 | + reiserfs_panic(sb, "journal-1702", | |
2007 | "journal_list_bitmap is NULL"); | |
2008 | } | |
2009 | - set_bit_in_list_bitmap(p_s_sb, blocknr, jb); | |
2010 | + set_bit_in_list_bitmap(sb, blocknr, jb); | |
2011 | ||
2012 | /* Note, the entire while loop is not allowed to schedule. */ | |
2013 | ||
2014 | @@ -3718,13 +3717,13 @@ int journal_mark_freed(struct reiserfs_t | |
2015 | clear_prepared_bits(bh); | |
2016 | reiserfs_clean_and_file_buffer(bh); | |
2017 | } | |
2018 | - cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned); | |
2019 | + cleaned = remove_from_transaction(sb, blocknr, cleaned); | |
2020 | ||
2021 | /* find all older transactions with this block, make sure they don't try to write it out */ | |
2022 | - cn = get_journal_hash_dev(p_s_sb, journal->j_list_hash_table, | |
2023 | + cn = get_journal_hash_dev(sb, journal->j_list_hash_table, | |
2024 | blocknr); | |
2025 | while (cn) { | |
2026 | - if (p_s_sb == cn->sb && blocknr == cn->blocknr) { | |
2027 | + if (sb == cn->sb && blocknr == cn->blocknr) { | |
2028 | set_bit(BLOCK_FREED, &cn->state); | |
2029 | if (cn->bh) { | |
2030 | if (!cleaned) { | |
2031 | @@ -3740,7 +3739,7 @@ int journal_mark_freed(struct reiserfs_t | |
2032 | put_bh(cn->bh); | |
2033 | if (atomic_read | |
2034 | (&(cn->bh->b_count)) < 0) { | |
2035 | - reiserfs_warning(p_s_sb, | |
2036 | + reiserfs_warning(sb, | |
2037 | "journal-2138", | |
2038 | "cn->bh->b_count < 0"); | |
2039 | } | |
2040 | @@ -3847,18 +3846,18 @@ int reiserfs_commit_for_inode(struct ino | |
2041 | return __commit_trans_jl(inode, id, jl); | |
2042 | } | |
2043 | ||
2044 | -void reiserfs_restore_prepared_buffer(struct super_block *p_s_sb, | |
2045 | +void reiserfs_restore_prepared_buffer(struct super_block *sb, | |
2046 | struct buffer_head *bh) | |
2047 | { | |
2048 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
2049 | - PROC_INFO_INC(p_s_sb, journal.restore_prepared); | |
2050 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
2051 | + PROC_INFO_INC(sb, journal.restore_prepared); | |
2052 | if (!bh) { | |
2053 | return; | |
2054 | } | |
2055 | if (test_clear_buffer_journal_restore_dirty(bh) && | |
2056 | buffer_journal_dirty(bh)) { | |
2057 | struct reiserfs_journal_cnode *cn; | |
2058 | - cn = get_journal_hash_dev(p_s_sb, | |
2059 | + cn = get_journal_hash_dev(sb, | |
2060 | journal->j_list_hash_table, | |
2061 | bh->b_blocknr); | |
2062 | if (cn && can_dirty(cn)) { | |
2063 | @@ -3877,10 +3876,10 @@ extern struct tree_balance *cur_tb; | |
2064 | ** wait on it. | |
2065 | ** | |
2066 | */ | |
2067 | -int reiserfs_prepare_for_journal(struct super_block *p_s_sb, | |
2068 | +int reiserfs_prepare_for_journal(struct super_block *sb, | |
2069 | struct buffer_head *bh, int wait) | |
2070 | { | |
2071 | - PROC_INFO_INC(p_s_sb, journal.prepare); | |
2072 | + PROC_INFO_INC(sb, journal.prepare); | |
2073 | ||
2074 | if (!trylock_buffer(bh)) { | |
2075 | if (!wait) | |
2076 | @@ -3928,10 +3927,10 @@ static void flush_old_journal_lists(stru | |
2077 | ** journal lists, etc just won't happen. | |
2078 | */ | |
2079 | static int do_journal_end(struct reiserfs_transaction_handle *th, | |
2080 | - struct super_block *p_s_sb, unsigned long nblocks, | |
2081 | + struct super_block *sb, unsigned long nblocks, | |
2082 | int flags) | |
2083 | { | |
2084 | - struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | |
2085 | + struct reiserfs_journal *journal = SB_JOURNAL(sb); | |
2086 | struct reiserfs_journal_cnode *cn, *next, *jl_cn; | |
2087 | struct reiserfs_journal_cnode *last_cn = NULL; | |
2088 | struct reiserfs_journal_desc *desc; | |
2089 | @@ -3961,14 +3960,14 @@ static int do_journal_end(struct reiserf | |
2090 | ||
2091 | put_fs_excl(); | |
2092 | current->journal_info = th->t_handle_save; | |
2093 | - reiserfs_check_lock_depth(p_s_sb, "journal end"); | |
2094 | + reiserfs_check_lock_depth(sb, "journal end"); | |
2095 | if (journal->j_len == 0) { | |
2096 | - reiserfs_prepare_for_journal(p_s_sb, SB_BUFFER_WITH_SB(p_s_sb), | |
2097 | + reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb), | |
2098 | 1); | |
2099 | - journal_mark_dirty(th, p_s_sb, SB_BUFFER_WITH_SB(p_s_sb)); | |
2100 | + journal_mark_dirty(th, sb, SB_BUFFER_WITH_SB(sb)); | |
2101 | } | |
2102 | ||
2103 | - lock_journal(p_s_sb); | |
2104 | + lock_journal(sb); | |
2105 | if (journal->j_next_full_flush) { | |
2106 | flags |= FLUSH_ALL; | |
2107 | flush = 1; | |
2108 | @@ -3981,10 +3980,10 @@ static int do_journal_end(struct reiserf | |
2109 | /* check_journal_end locks the journal, and unlocks if it does not return 1 | |
2110 | ** it tells us if we should continue with the journal_end, or just return | |
2111 | */ | |
2112 | - if (!check_journal_end(th, p_s_sb, nblocks, flags)) { | |
2113 | - p_s_sb->s_dirt = 1; | |
2114 | - wake_queued_writers(p_s_sb); | |
2115 | - reiserfs_async_progress_wait(p_s_sb); | |
2116 | + if (!check_journal_end(th, sb, nblocks, flags)) { | |
2117 | + sb->s_dirt = 1; | |
2118 | + wake_queued_writers(sb); | |
2119 | + reiserfs_async_progress_wait(sb); | |
2120 | goto out; | |
2121 | } | |
2122 | ||
2123 | @@ -4013,8 +4012,8 @@ static int do_journal_end(struct reiserf | |
2124 | ||
2125 | /* setup description block */ | |
2126 | d_bh = | |
2127 | - journal_getblk(p_s_sb, | |
2128 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
2129 | + journal_getblk(sb, | |
2130 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
2131 | journal->j_start); | |
2132 | set_buffer_uptodate(d_bh); | |
2133 | desc = (struct reiserfs_journal_desc *)(d_bh)->b_data; | |
2134 | @@ -4023,9 +4022,9 @@ static int do_journal_end(struct reiserf | |
2135 | set_desc_trans_id(desc, journal->j_trans_id); | |
2136 | ||
2137 | /* setup commit block. Don't write (keep it clean too) this one until after everyone else is written */ | |
2138 | - c_bh = journal_getblk(p_s_sb, SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
2139 | + c_bh = journal_getblk(sb, SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
2140 | ((journal->j_start + journal->j_len + | |
2141 | - 1) % SB_ONDISK_JOURNAL_SIZE(p_s_sb))); | |
2142 | + 1) % SB_ONDISK_JOURNAL_SIZE(sb))); | |
2143 | commit = (struct reiserfs_journal_commit *)c_bh->b_data; | |
2144 | memset(c_bh->b_data, 0, c_bh->b_size); | |
2145 | set_commit_trans_id(commit, journal->j_trans_id); | |
2146 | @@ -4058,12 +4057,12 @@ static int do_journal_end(struct reiserf | |
2147 | ** for each real block, add it to the journal list hash, | |
2148 | ** copy into real block index array in the commit or desc block | |
2149 | */ | |
2150 | - trans_half = journal_trans_half(p_s_sb->s_blocksize); | |
2151 | + trans_half = journal_trans_half(sb->s_blocksize); | |
2152 | for (i = 0, cn = journal->j_first; cn; cn = cn->next, i++) { | |
2153 | if (buffer_journaled(cn->bh)) { | |
2154 | - jl_cn = get_cnode(p_s_sb); | |
2155 | + jl_cn = get_cnode(sb); | |
2156 | if (!jl_cn) { | |
2157 | - reiserfs_panic(p_s_sb, "journal-1676", | |
2158 | + reiserfs_panic(sb, "journal-1676", | |
2159 | "get_cnode returned NULL"); | |
2160 | } | |
2161 | if (i == 0) { | |
2162 | @@ -4079,15 +4078,15 @@ static int do_journal_end(struct reiserf | |
2163 | of journal or reserved area */ | |
2164 | ||
2165 | if (is_block_in_log_or_reserved_area | |
2166 | - (p_s_sb, cn->bh->b_blocknr)) { | |
2167 | - reiserfs_panic(p_s_sb, "journal-2332", | |
2168 | + (sb, cn->bh->b_blocknr)) { | |
2169 | + reiserfs_panic(sb, "journal-2332", | |
2170 | "Trying to log block %lu, " | |
2171 | "which is a log block", | |
2172 | cn->bh->b_blocknr); | |
2173 | } | |
2174 | jl_cn->blocknr = cn->bh->b_blocknr; | |
2175 | jl_cn->state = 0; | |
2176 | - jl_cn->sb = p_s_sb; | |
2177 | + jl_cn->sb = sb; | |
2178 | jl_cn->bh = cn->bh; | |
2179 | jl_cn->jlist = jl; | |
2180 | insert_journal_hash(journal->j_list_hash_table, jl_cn); | |
2181 | @@ -4128,11 +4127,11 @@ static int do_journal_end(struct reiserf | |
2182 | char *addr; | |
2183 | struct page *page; | |
2184 | tmp_bh = | |
2185 | - journal_getblk(p_s_sb, | |
2186 | - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | |
2187 | + journal_getblk(sb, | |
2188 | + SB_ONDISK_JOURNAL_1st_BLOCK(sb) + | |
2189 | ((cur_write_start + | |
2190 | jindex) % | |
2191 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb))); | |
2192 | + SB_ONDISK_JOURNAL_SIZE(sb))); | |
2193 | set_buffer_uptodate(tmp_bh); | |
2194 | page = cn->bh->b_page; | |
2195 | addr = kmap(page); | |
2196 | @@ -4146,13 +4145,13 @@ static int do_journal_end(struct reiserf | |
2197 | clear_buffer_journaled(cn->bh); | |
2198 | } else { | |
2199 | /* JDirty cleared sometime during transaction. don't log this one */ | |
2200 | - reiserfs_warning(p_s_sb, "journal-2048", | |
2201 | + reiserfs_warning(sb, "journal-2048", | |
2202 | "BAD, buffer in journal hash, " | |
2203 | "but not JDirty!"); | |
2204 | brelse(cn->bh); | |
2205 | } | |
2206 | next = cn->next; | |
2207 | - free_cnode(p_s_sb, cn); | |
2208 | + free_cnode(sb, cn); | |
2209 | cn = next; | |
2210 | cond_resched(); | |
2211 | } | |
2212 | @@ -4162,7 +4161,7 @@ static int do_journal_end(struct reiserf | |
2213 | ** so we dirty/relse c_bh in flush_commit_list, with commit_left <= 1. | |
2214 | */ | |
2215 | ||
2216 | - journal->j_current_jl = alloc_journal_list(p_s_sb); | |
2217 | + journal->j_current_jl = alloc_journal_list(sb); | |
2218 | ||
2219 | /* now it is safe to insert this transaction on the main list */ | |
2220 | list_add_tail(&jl->j_list, &journal->j_journal_list); | |
2221 | @@ -4173,7 +4172,7 @@ static int do_journal_end(struct reiserf | |
2222 | old_start = journal->j_start; | |
2223 | journal->j_start = | |
2224 | (journal->j_start + journal->j_len + | |
2225 | - 2) % SB_ONDISK_JOURNAL_SIZE(p_s_sb); | |
2226 | + 2) % SB_ONDISK_JOURNAL_SIZE(sb); | |
2227 | atomic_set(&(journal->j_wcount), 0); | |
2228 | journal->j_bcount = 0; | |
2229 | journal->j_last = NULL; | |
2230 | @@ -4188,7 +4187,7 @@ static int do_journal_end(struct reiserf | |
2231 | journal->j_len_alloc = 0; | |
2232 | journal->j_next_full_flush = 0; | |
2233 | journal->j_next_async_flush = 0; | |
2234 | - init_journal_hash(p_s_sb); | |
2235 | + init_journal_hash(sb); | |
2236 | ||
2237 | // make sure reiserfs_add_jh sees the new current_jl before we | |
2238 | // write out the tails | |
2239 | @@ -4217,8 +4216,8 @@ static int do_journal_end(struct reiserf | |
2240 | ** queue don't wait for this proc to flush journal lists and such. | |
2241 | */ | |
2242 | if (flush) { | |
2243 | - flush_commit_list(p_s_sb, jl, 1); | |
2244 | - flush_journal_list(p_s_sb, jl, 1); | |
2245 | + flush_commit_list(sb, jl, 1); | |
2246 | + flush_journal_list(sb, jl, 1); | |
2247 | } else if (!(jl->j_state & LIST_COMMIT_PENDING)) | |
2248 | queue_delayed_work(commit_wq, &journal->j_work, HZ / 10); | |
2249 | ||
2250 | @@ -4232,11 +4231,11 @@ static int do_journal_end(struct reiserf | |
2251 | if (journal->j_start <= temp_jl->j_start) { | |
2252 | if ((journal->j_start + journal->j_trans_max + 1) >= | |
2253 | temp_jl->j_start) { | |
2254 | - flush_used_journal_lists(p_s_sb, temp_jl); | |
2255 | + flush_used_journal_lists(sb, temp_jl); | |
2256 | goto first_jl; | |
2257 | } else if ((journal->j_start + | |
2258 | journal->j_trans_max + 1) < | |
2259 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { | |
2260 | + SB_ONDISK_JOURNAL_SIZE(sb)) { | |
2261 | /* if we don't cross into the next transaction and we don't | |
2262 | * wrap, there is no way we can overlap any later transactions | |
2263 | * break now | |
2264 | @@ -4245,11 +4244,11 @@ static int do_journal_end(struct reiserf | |
2265 | } | |
2266 | } else if ((journal->j_start + | |
2267 | journal->j_trans_max + 1) > | |
2268 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { | |
2269 | + SB_ONDISK_JOURNAL_SIZE(sb)) { | |
2270 | if (((journal->j_start + journal->j_trans_max + 1) % | |
2271 | - SB_ONDISK_JOURNAL_SIZE(p_s_sb)) >= | |
2272 | + SB_ONDISK_JOURNAL_SIZE(sb)) >= | |
2273 | temp_jl->j_start) { | |
2274 | - flush_used_journal_lists(p_s_sb, temp_jl); | |
2275 | + flush_used_journal_lists(sb, temp_jl); | |
2276 | goto first_jl; | |
2277 | } else { | |
2278 | /* we don't overlap anything from out start to the end of the | |
2279 | @@ -4260,34 +4259,34 @@ static int do_journal_end(struct reiserf | |
2280 | } | |
2281 | } | |
2282 | } | |
2283 | - flush_old_journal_lists(p_s_sb); | |
2284 | + flush_old_journal_lists(sb); | |
2285 | ||
2286 | journal->j_current_jl->j_list_bitmap = | |
2287 | - get_list_bitmap(p_s_sb, journal->j_current_jl); | |
2288 | + get_list_bitmap(sb, journal->j_current_jl); | |
2289 | ||
2290 | if (!(journal->j_current_jl->j_list_bitmap)) { | |
2291 | - reiserfs_panic(p_s_sb, "journal-1996", | |
2292 | + reiserfs_panic(sb, "journal-1996", | |
2293 | "could not get a list bitmap"); | |
2294 | } | |
2295 | ||
2296 | atomic_set(&(journal->j_jlock), 0); | |
2297 | - unlock_journal(p_s_sb); | |
2298 | + unlock_journal(sb); | |
2299 | /* wake up any body waiting to join. */ | |
2300 | clear_bit(J_WRITERS_QUEUED, &journal->j_state); | |
2301 | wake_up(&(journal->j_join_wait)); | |
2302 | ||
2303 | if (!flush && wait_on_commit && | |
2304 | - journal_list_still_alive(p_s_sb, commit_trans_id)) { | |
2305 | - flush_commit_list(p_s_sb, jl, 1); | |
2306 | + journal_list_still_alive(sb, commit_trans_id)) { | |
2307 | + flush_commit_list(sb, jl, 1); | |
2308 | } | |
2309 | out: | |
2310 | - reiserfs_check_lock_depth(p_s_sb, "journal end2"); | |
2311 | + reiserfs_check_lock_depth(sb, "journal end2"); | |
2312 | ||
2313 | memset(th, 0, sizeof(*th)); | |
2314 | /* Re-set th->t_super, so we can properly keep track of how many | |
2315 | * persistent transactions there are. We need to do this so if this | |
2316 | * call is part of a failed restart_transaction, we can free it later */ | |
2317 | - th->t_super = p_s_sb; | |
2318 | + th->t_super = sb; | |
2319 | ||
2320 | return journal->j_errno; | |
2321 | } | |
2322 | --- a/fs/reiserfs/stree.c | |
2323 | +++ b/fs/reiserfs/stree.c | |
2324 | @@ -245,7 +245,7 @@ static const struct reiserfs_key MAX_KEY | |
2325 | static inline const struct reiserfs_key *get_lkey(const struct treepath | |
2326 | *p_s_chk_path, | |
2327 | const struct super_block | |
2328 | - *p_s_sb) | |
2329 | + *sb) | |
2330 | { | |
2331 | int n_position, n_path_offset = p_s_chk_path->path_length; | |
2332 | struct buffer_head *p_s_parent; | |
2333 | @@ -282,14 +282,14 @@ static inline const struct reiserfs_key | |
2334 | } | |
2335 | /* Return MIN_KEY if we are in the root of the buffer tree. */ | |
2336 | if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)-> | |
2337 | - b_blocknr == SB_ROOT_BLOCK(p_s_sb)) | |
2338 | + b_blocknr == SB_ROOT_BLOCK(sb)) | |
2339 | return &MIN_KEY; | |
2340 | return &MAX_KEY; | |
2341 | } | |
2342 | ||
2343 | /* Get delimiting key of the buffer at the path and its right neighbor. */ | |
2344 | inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, | |
2345 | - const struct super_block *p_s_sb) | |
2346 | + const struct super_block *sb) | |
2347 | { | |
2348 | int n_position, n_path_offset = p_s_chk_path->path_length; | |
2349 | struct buffer_head *p_s_parent; | |
2350 | @@ -325,7 +325,7 @@ inline const struct reiserfs_key *get_rk | |
2351 | } | |
2352 | /* Return MAX_KEY if we are in the root of the buffer tree. */ | |
2353 | if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)-> | |
2354 | - b_blocknr == SB_ROOT_BLOCK(p_s_sb)) | |
2355 | + b_blocknr == SB_ROOT_BLOCK(sb)) | |
2356 | return &MAX_KEY; | |
2357 | return &MIN_KEY; | |
2358 | } | |
2359 | @@ -337,7 +337,7 @@ inline const struct reiserfs_key *get_rk | |
2360 | this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */ | |
2361 | static inline int key_in_buffer(struct treepath *p_s_chk_path, /* Path which should be checked. */ | |
2362 | const struct cpu_key *p_s_key, /* Key which should be checked. */ | |
2363 | - struct super_block *p_s_sb /* Super block pointer. */ | |
2364 | + struct super_block *sb /* Super block pointer. */ | |
2365 | ) | |
2366 | { | |
2367 | ||
2368 | @@ -348,11 +348,11 @@ static inline int key_in_buffer(struct t | |
2369 | RFALSE(!PATH_PLAST_BUFFER(p_s_chk_path)->b_bdev, | |
2370 | "PAP-5060: device must not be NODEV"); | |
2371 | ||
2372 | - if (comp_keys(get_lkey(p_s_chk_path, p_s_sb), p_s_key) == 1) | |
2373 | + if (comp_keys(get_lkey(p_s_chk_path, sb), p_s_key) == 1) | |
2374 | /* left delimiting key is bigger, that the key we look for */ | |
2375 | return 0; | |
2376 | - // if ( comp_keys(p_s_key, get_rkey(p_s_chk_path, p_s_sb)) != -1 ) | |
2377 | - if (comp_keys(get_rkey(p_s_chk_path, p_s_sb), p_s_key) != 1) | |
2378 | + // if ( comp_keys(p_s_key, get_rkey(p_s_chk_path, sb)) != -1 ) | |
2379 | + if (comp_keys(get_rkey(p_s_chk_path, sb), p_s_key) != 1) | |
2380 | /* p_s_key must be less than right delimitiing key */ | |
2381 | return 0; | |
2382 | return 1; | |
2383 | @@ -546,7 +546,7 @@ static void search_by_key_reada(struct s | |
2384 | /************************************************************************** | |
2385 | * Algorithm SearchByKey * | |
2386 | * look for item in the Disk S+Tree by its key * | |
2387 | - * Input: p_s_sb - super block * | |
2388 | + * Input: sb - super block * | |
2389 | * p_s_key - pointer to the key to search * | |
2390 | * Output: ITEM_FOUND, ITEM_NOT_FOUND or IO_ERROR * | |
2391 | * p_s_search_path - path from the root to the needed leaf * | |
2392 | @@ -566,7 +566,7 @@ static void search_by_key_reada(struct s | |
2393 | correctness of the top of the path but need not be checked for the | |
2394 | correctness of the bottom of the path */ | |
2395 | /* The function is NOT SCHEDULE-SAFE! */ | |
2396 | -int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* Key to search. */ | |
2397 | +int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key to search. */ | |
2398 | struct treepath *p_s_search_path,/* This structure was | |
2399 | allocated and initialized | |
2400 | by the calling | |
2401 | @@ -592,7 +592,7 @@ int search_by_key(struct super_block *p_ | |
2402 | int n_repeat_counter = 0; | |
2403 | #endif | |
2404 | ||
2405 | - PROC_INFO_INC(p_s_sb, search_by_key); | |
2406 | + PROC_INFO_INC(sb, search_by_key); | |
2407 | ||
2408 | /* As we add each node to a path we increase its count. This means that | |
2409 | we must be careful to release all nodes in a path before we either | |
2410 | @@ -605,13 +605,13 @@ int search_by_key(struct super_block *p_ | |
2411 | /* With each iteration of this loop we search through the items in the | |
2412 | current node, and calculate the next current node(next path element) | |
2413 | for the next iteration of this loop.. */ | |
2414 | - n_block_number = SB_ROOT_BLOCK(p_s_sb); | |
2415 | + n_block_number = SB_ROOT_BLOCK(sb); | |
2416 | expected_level = -1; | |
2417 | while (1) { | |
2418 | ||
2419 | #ifdef CONFIG_REISERFS_CHECK | |
2420 | if (!(++n_repeat_counter % 50000)) | |
2421 | - reiserfs_warning(p_s_sb, "PAP-5100", | |
2422 | + reiserfs_warning(sb, "PAP-5100", | |
2423 | "%s: there were %d iterations of " | |
2424 | "while loop looking for key %K", | |
2425 | current->comm, n_repeat_counter, | |
2426 | @@ -622,14 +622,14 @@ int search_by_key(struct super_block *p_ | |
2427 | p_s_last_element = | |
2428 | PATH_OFFSET_PELEMENT(p_s_search_path, | |
2429 | ++p_s_search_path->path_length); | |
2430 | - fs_gen = get_generation(p_s_sb); | |
2431 | + fs_gen = get_generation(sb); | |
2432 | ||
2433 | /* Read the next tree node, and set the last element in the path to | |
2434 | have a pointer to it. */ | |
2435 | if ((p_s_bh = p_s_last_element->pe_buffer = | |
2436 | - sb_getblk(p_s_sb, n_block_number))) { | |
2437 | + sb_getblk(sb, n_block_number))) { | |
2438 | if (!buffer_uptodate(p_s_bh) && reada_count > 1) { | |
2439 | - search_by_key_reada(p_s_sb, reada_bh, | |
2440 | + search_by_key_reada(sb, reada_bh, | |
2441 | reada_blocks, reada_count); | |
2442 | } | |
2443 | ll_rw_block(READ, 1, &p_s_bh); | |
2444 | @@ -644,25 +644,25 @@ int search_by_key(struct super_block *p_ | |
2445 | } | |
2446 | reada_count = 0; | |
2447 | if (expected_level == -1) | |
2448 | - expected_level = SB_TREE_HEIGHT(p_s_sb); | |
2449 | + expected_level = SB_TREE_HEIGHT(sb); | |
2450 | expected_level--; | |
2451 | ||
2452 | /* It is possible that schedule occurred. We must check whether the key | |
2453 | to search is still in the tree rooted from the current buffer. If | |
2454 | not then repeat search from the root. */ | |
2455 | - if (fs_changed(fs_gen, p_s_sb) && | |
2456 | + if (fs_changed(fs_gen, sb) && | |
2457 | (!B_IS_IN_TREE(p_s_bh) || | |
2458 | B_LEVEL(p_s_bh) != expected_level || | |
2459 | - !key_in_buffer(p_s_search_path, p_s_key, p_s_sb))) { | |
2460 | - PROC_INFO_INC(p_s_sb, search_by_key_fs_changed); | |
2461 | - PROC_INFO_INC(p_s_sb, search_by_key_restarted); | |
2462 | - PROC_INFO_INC(p_s_sb, | |
2463 | + !key_in_buffer(p_s_search_path, p_s_key, sb))) { | |
2464 | + PROC_INFO_INC(sb, search_by_key_fs_changed); | |
2465 | + PROC_INFO_INC(sb, search_by_key_restarted); | |
2466 | + PROC_INFO_INC(sb, | |
2467 | sbk_restarted[expected_level - 1]); | |
2468 | pathrelse(p_s_search_path); | |
2469 | ||
2470 | /* Get the root block number so that we can repeat the search | |
2471 | starting from the root. */ | |
2472 | - n_block_number = SB_ROOT_BLOCK(p_s_sb); | |
2473 | + n_block_number = SB_ROOT_BLOCK(sb); | |
2474 | expected_level = -1; | |
2475 | right_neighbor_of_leaf_node = 0; | |
2476 | ||
2477 | @@ -674,12 +674,12 @@ int search_by_key(struct super_block *p_ | |
2478 | equal to the MAX_KEY. Latter case is only possible in | |
2479 | "finish_unfinished()" processing during mount. */ | |
2480 | RFALSE(comp_keys(&MAX_KEY, p_s_key) && | |
2481 | - !key_in_buffer(p_s_search_path, p_s_key, p_s_sb), | |
2482 | + !key_in_buffer(p_s_search_path, p_s_key, sb), | |
2483 | "PAP-5130: key is not in the buffer"); | |
2484 | #ifdef CONFIG_REISERFS_CHECK | |
2485 | if (cur_tb) { | |
2486 | print_cur_tb("5140"); | |
2487 | - reiserfs_panic(p_s_sb, "PAP-5140", | |
2488 | + reiserfs_panic(sb, "PAP-5140", | |
2489 | "schedule occurred in do_balance!"); | |
2490 | } | |
2491 | #endif | |
2492 | @@ -687,7 +687,7 @@ int search_by_key(struct super_block *p_ | |
2493 | // make sure, that the node contents look like a node of | |
2494 | // certain level | |
2495 | if (!is_tree_node(p_s_bh, expected_level)) { | |
2496 | - reiserfs_error(p_s_sb, "vs-5150", | |
2497 | + reiserfs_error(sb, "vs-5150", | |
2498 | "invalid format found in block %ld. " | |
2499 | "Fsck?", p_s_bh->b_blocknr); | |
2500 | pathrelse(p_s_search_path); | |
2501 | @@ -697,7 +697,7 @@ int search_by_key(struct super_block *p_ | |
2502 | /* ok, we have acquired next formatted node in the tree */ | |
2503 | n_node_level = B_LEVEL(p_s_bh); | |
2504 | ||
2505 | - PROC_INFO_BH_STAT(p_s_sb, p_s_bh, n_node_level - 1); | |
2506 | + PROC_INFO_BH_STAT(sb, p_s_bh, n_node_level - 1); | |
2507 | ||
2508 | RFALSE(n_node_level < n_stop_level, | |
2509 | "vs-5152: tree level (%d) is less than stop level (%d)", | |
2510 | @@ -776,7 +776,7 @@ int search_by_key(struct super_block *p_ | |
2511 | units of directory entries. */ | |
2512 | ||
2513 | /* The function is NOT SCHEDULE-SAFE! */ | |
2514 | -int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the super block. */ | |
2515 | +int search_for_position_by_key(struct super_block *sb, /* Pointer to the super block. */ | |
2516 | const struct cpu_key *p_cpu_key, /* Key to search (cpu variable) */ | |
2517 | struct treepath *p_s_search_path /* Filled up by this function. */ | |
2518 | ) | |
2519 | @@ -789,13 +789,13 @@ int search_for_position_by_key(struct su | |
2520 | ||
2521 | /* If searching for directory entry. */ | |
2522 | if (is_direntry_cpu_key(p_cpu_key)) | |
2523 | - return search_by_entry_key(p_s_sb, p_cpu_key, p_s_search_path, | |
2524 | + return search_by_entry_key(sb, p_cpu_key, p_s_search_path, | |
2525 | &de); | |
2526 | ||
2527 | /* If not searching for directory entry. */ | |
2528 | ||
2529 | /* If item is found. */ | |
2530 | - retval = search_item(p_s_sb, p_cpu_key, p_s_search_path); | |
2531 | + retval = search_item(sb, p_cpu_key, p_s_search_path); | |
2532 | if (retval == IO_ERROR) | |
2533 | return retval; | |
2534 | if (retval == ITEM_FOUND) { | |
2535 | @@ -817,7 +817,7 @@ int search_for_position_by_key(struct su | |
2536 | p_le_ih = | |
2537 | B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_search_path), | |
2538 | --PATH_LAST_POSITION(p_s_search_path)); | |
2539 | - n_blk_size = p_s_sb->s_blocksize; | |
2540 | + n_blk_size = sb->s_blocksize; | |
2541 | ||
2542 | if (comp_short_keys(&(p_le_ih->ih_key), p_cpu_key)) { | |
2543 | return FILE_NOT_FOUND; | |
2544 | @@ -957,7 +957,7 @@ static char prepare_for_delete_or_cut(st | |
2545 | int *p_n_cut_size, unsigned long long n_new_file_length /* MAX_KEY_OFFSET in case of delete. */ | |
2546 | ) | |
2547 | { | |
2548 | - struct super_block *p_s_sb = inode->i_sb; | |
2549 | + struct super_block *sb = inode->i_sb; | |
2550 | struct item_head *p_le_ih = PATH_PITEM_HEAD(p_s_path); | |
2551 | struct buffer_head *p_s_bh = PATH_PLAST_BUFFER(p_s_path); | |
2552 | ||
2553 | @@ -986,7 +986,7 @@ static char prepare_for_delete_or_cut(st | |
2554 | ||
2555 | /* Case of an indirect item. */ | |
2556 | { | |
2557 | - int blk_size = p_s_sb->s_blocksize; | |
2558 | + int blk_size = sb->s_blocksize; | |
2559 | struct item_head s_ih; | |
2560 | int need_re_search; | |
2561 | int delete = 0; | |
2562 | @@ -1023,9 +1023,9 @@ static char prepare_for_delete_or_cut(st | |
2563 | block = get_block_num(unfm, 0); | |
2564 | ||
2565 | if (block != 0) { | |
2566 | - reiserfs_prepare_for_journal(p_s_sb, p_s_bh, 1); | |
2567 | + reiserfs_prepare_for_journal(sb, p_s_bh, 1); | |
2568 | put_block_num(unfm, 0, 0); | |
2569 | - journal_mark_dirty (th, p_s_sb, p_s_bh); | |
2570 | + journal_mark_dirty (th, sb, p_s_bh); | |
2571 | reiserfs_free_block(th, inode, block, 1); | |
2572 | } | |
2573 | ||
2574 | @@ -1049,9 +1049,9 @@ static char prepare_for_delete_or_cut(st | |
2575 | /* a trick. If the buffer has been logged, this will do nothing. If | |
2576 | ** we've broken the loop without logging it, it will restore the | |
2577 | ** buffer */ | |
2578 | - reiserfs_restore_prepared_buffer(p_s_sb, p_s_bh); | |
2579 | + reiserfs_restore_prepared_buffer(sb, p_s_bh); | |
2580 | } while (need_re_search && | |
2581 | - search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path) == POSITION_FOUND); | |
2582 | + search_for_position_by_key(sb, p_s_item_key, p_s_path) == POSITION_FOUND); | |
2583 | pos_in_item(p_s_path) = pos * UNFM_P_SIZE; | |
2584 | ||
2585 | if (*p_n_cut_size == 0) { | |
2586 | @@ -1090,7 +1090,7 @@ static int calc_deleted_bytes_number(str | |
2587 | ||
2588 | static void init_tb_struct(struct reiserfs_transaction_handle *th, | |
2589 | struct tree_balance *p_s_tb, | |
2590 | - struct super_block *p_s_sb, | |
2591 | + struct super_block *sb, | |
2592 | struct treepath *p_s_path, int n_size) | |
2593 | { | |
2594 | ||
2595 | @@ -1098,7 +1098,7 @@ static void init_tb_struct(struct reiser | |
2596 | ||
2597 | memset(p_s_tb, '\0', sizeof(struct tree_balance)); | |
2598 | p_s_tb->transaction_handle = th; | |
2599 | - p_s_tb->tb_sb = p_s_sb; | |
2600 | + p_s_tb->tb_sb = sb; | |
2601 | p_s_tb->tb_path = p_s_path; | |
2602 | PATH_OFFSET_PBUFFER(p_s_path, ILLEGAL_PATH_ELEMENT_OFFSET) = NULL; | |
2603 | PATH_OFFSET_POSITION(p_s_path, ILLEGAL_PATH_ELEMENT_OFFSET) = 0; | |
2604 | @@ -1147,7 +1147,7 @@ int reiserfs_delete_item(struct reiserfs | |
2605 | struct inode *p_s_inode, /* inode is here just to update i_blocks and quotas */ | |
2606 | struct buffer_head *p_s_un_bh) | |
2607 | { /* NULL or unformatted node pointer. */ | |
2608 | - struct super_block *p_s_sb = p_s_inode->i_sb; | |
2609 | + struct super_block *sb = p_s_inode->i_sb; | |
2610 | struct tree_balance s_del_balance; | |
2611 | struct item_head s_ih; | |
2612 | struct item_head *q_ih; | |
2613 | @@ -1161,7 +1161,7 @@ int reiserfs_delete_item(struct reiserfs | |
2614 | ||
2615 | BUG_ON(!th->t_trans_id); | |
2616 | ||
2617 | - init_tb_struct(th, &s_del_balance, p_s_sb, p_s_path, | |
2618 | + init_tb_struct(th, &s_del_balance, sb, p_s_path, | |
2619 | 0 /*size is unknown */ ); | |
2620 | ||
2621 | while (1) { | |
2622 | @@ -1185,15 +1185,15 @@ int reiserfs_delete_item(struct reiserfs | |
2623 | if (n_ret_value != REPEAT_SEARCH) | |
2624 | break; | |
2625 | ||
2626 | - PROC_INFO_INC(p_s_sb, delete_item_restarted); | |
2627 | + PROC_INFO_INC(sb, delete_item_restarted); | |
2628 | ||
2629 | // file system changed, repeat search | |
2630 | n_ret_value = | |
2631 | - search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path); | |
2632 | + search_for_position_by_key(sb, p_s_item_key, p_s_path); | |
2633 | if (n_ret_value == IO_ERROR) | |
2634 | break; | |
2635 | if (n_ret_value == FILE_NOT_FOUND) { | |
2636 | - reiserfs_warning(p_s_sb, "vs-5340", | |
2637 | + reiserfs_warning(sb, "vs-5340", | |
2638 | "no items of the file %K found", | |
2639 | p_s_item_key); | |
2640 | break; | |
2641 | @@ -1216,8 +1216,8 @@ int reiserfs_delete_item(struct reiserfs | |
2642 | ** the unfm node once | |
2643 | */ | |
2644 | if (!S_ISLNK(p_s_inode->i_mode) && is_direct_le_ih(q_ih)) { | |
2645 | - if ((le_ih_k_offset(q_ih) & (p_s_sb->s_blocksize - 1)) == 1) { | |
2646 | - quota_cut_bytes = p_s_sb->s_blocksize + UNFM_P_SIZE; | |
2647 | + if ((le_ih_k_offset(q_ih) & (sb->s_blocksize - 1)) == 1) { | |
2648 | + quota_cut_bytes = sb->s_blocksize + UNFM_P_SIZE; | |
2649 | } else { | |
2650 | quota_cut_bytes = 0; | |
2651 | } | |
2652 | @@ -1258,7 +1258,7 @@ int reiserfs_delete_item(struct reiserfs | |
2653 | do_balance(&s_del_balance, NULL, NULL, M_DELETE); | |
2654 | ||
2655 | #ifdef REISERQUOTA_DEBUG | |
2656 | - reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, | |
2657 | + reiserfs_debug(sb, REISERFS_DEBUG_CODE, | |
2658 | "reiserquota delete_item(): freeing %u, id=%u type=%c", | |
2659 | quota_cut_bytes, p_s_inode->i_uid, head2type(&s_ih)); | |
2660 | #endif | |
2661 | @@ -1430,8 +1430,8 @@ static int maybe_indirect_to_direct(stru | |
2662 | const struct cpu_key *p_s_item_key, | |
2663 | loff_t n_new_file_size, char *p_c_mode) | |
2664 | { | |
2665 | - struct super_block *p_s_sb = p_s_inode->i_sb; | |
2666 | - int n_block_size = p_s_sb->s_blocksize; | |
2667 | + struct super_block *sb = p_s_inode->i_sb; | |
2668 | + int n_block_size = sb->s_blocksize; | |
2669 | int cut_bytes; | |
2670 | BUG_ON(!th->t_trans_id); | |
2671 | BUG_ON(n_new_file_size != p_s_inode->i_size); | |
2672 | @@ -1509,7 +1509,7 @@ int reiserfs_cut_from_item(struct reiser | |
2673 | struct inode *p_s_inode, | |
2674 | struct page *page, loff_t n_new_file_size) | |
2675 | { | |
2676 | - struct super_block *p_s_sb = p_s_inode->i_sb; | |
2677 | + struct super_block *sb = p_s_inode->i_sb; | |
2678 | /* Every function which is going to call do_balance must first | |
2679 | create a tree_balance structure. Then it must fill up this | |
2680 | structure by using the init_tb_struct and fix_nodes functions. | |
2681 | @@ -1560,7 +1560,7 @@ int reiserfs_cut_from_item(struct reiser | |
2682 | /* removing of last unformatted node will change value we | |
2683 | have to return to truncate. Save it */ | |
2684 | retval2 = n_ret_value; | |
2685 | - /*retval2 = p_s_sb->s_blocksize - (n_new_file_size & (p_s_sb->s_blocksize - 1)); */ | |
2686 | + /*retval2 = sb->s_blocksize - (n_new_file_size & (sb->s_blocksize - 1)); */ | |
2687 | ||
2688 | /* So, we have performed the first part of the conversion: | |
2689 | inserting the new direct item. Now we are removing the | |
2690 | @@ -1569,16 +1569,16 @@ int reiserfs_cut_from_item(struct reiser | |
2691 | set_cpu_key_k_type(p_s_item_key, TYPE_INDIRECT); | |
2692 | p_s_item_key->key_length = 4; | |
2693 | n_new_file_size -= | |
2694 | - (n_new_file_size & (p_s_sb->s_blocksize - 1)); | |
2695 | + (n_new_file_size & (sb->s_blocksize - 1)); | |
2696 | tail_pos = n_new_file_size; | |
2697 | set_cpu_key_k_offset(p_s_item_key, n_new_file_size + 1); | |
2698 | if (search_for_position_by_key | |
2699 | - (p_s_sb, p_s_item_key, | |
2700 | + (sb, p_s_item_key, | |
2701 | p_s_path) == POSITION_NOT_FOUND) { | |
2702 | print_block(PATH_PLAST_BUFFER(p_s_path), 3, | |
2703 | PATH_LAST_POSITION(p_s_path) - 1, | |
2704 | PATH_LAST_POSITION(p_s_path) + 1); | |
2705 | - reiserfs_panic(p_s_sb, "PAP-5580", "item to " | |
2706 | + reiserfs_panic(sb, "PAP-5580", "item to " | |
2707 | "convert does not exist (%K)", | |
2708 | p_s_item_key); | |
2709 | } | |
2710 | @@ -1595,14 +1595,14 @@ int reiserfs_cut_from_item(struct reiser | |
2711 | if (n_ret_value != REPEAT_SEARCH) | |
2712 | break; | |
2713 | ||
2714 | - PROC_INFO_INC(p_s_sb, cut_from_item_restarted); | |
2715 | + PROC_INFO_INC(sb, cut_from_item_restarted); | |
2716 | ||
2717 | n_ret_value = | |
2718 | - search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path); | |
2719 | + search_for_position_by_key(sb, p_s_item_key, p_s_path); | |
2720 | if (n_ret_value == POSITION_FOUND) | |
2721 | continue; | |
2722 | ||
2723 | - reiserfs_warning(p_s_sb, "PAP-5610", "item %K not found", | |
2724 | + reiserfs_warning(sb, "PAP-5610", "item %K not found", | |
2725 | p_s_item_key); | |
2726 | unfix_nodes(&s_cut_balance); | |
2727 | return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT; | |
2728 | @@ -1616,7 +1616,7 @@ int reiserfs_cut_from_item(struct reiser | |
2729 | indirect_to_direct_roll_back(th, p_s_inode, p_s_path); | |
2730 | } | |
2731 | if (n_ret_value == NO_DISK_SPACE) | |
2732 | - reiserfs_warning(p_s_sb, "reiserfs-5092", | |
2733 | + reiserfs_warning(sb, "reiserfs-5092", | |
2734 | "NO_DISK_SPACE"); | |
2735 | unfix_nodes(&s_cut_balance); | |
2736 | return -EIO; | |
2737 | @@ -1642,11 +1642,11 @@ int reiserfs_cut_from_item(struct reiser | |
2738 | p_le_ih = PATH_PITEM_HEAD(s_cut_balance.tb_path); | |
2739 | if (!S_ISLNK(p_s_inode->i_mode) && is_direct_le_ih(p_le_ih)) { | |
2740 | if (c_mode == M_DELETE && | |
2741 | - (le_ih_k_offset(p_le_ih) & (p_s_sb->s_blocksize - 1)) == | |
2742 | + (le_ih_k_offset(p_le_ih) & (sb->s_blocksize - 1)) == | |
2743 | 1) { | |
2744 | // FIXME: this is to keep 3.5 happy | |
2745 | REISERFS_I(p_s_inode)->i_first_direct_byte = U32_MAX; | |
2746 | - quota_cut_bytes = p_s_sb->s_blocksize + UNFM_P_SIZE; | |
2747 | + quota_cut_bytes = sb->s_blocksize + UNFM_P_SIZE; | |
2748 | } else { | |
2749 | quota_cut_bytes = 0; | |
2750 | } | |
2751 | @@ -1659,18 +1659,18 @@ int reiserfs_cut_from_item(struct reiser | |
2752 | sure, that we exactly remove last unformatted node pointer | |
2753 | of the item */ | |
2754 | if (!is_indirect_le_ih(le_ih)) | |
2755 | - reiserfs_panic(p_s_sb, "vs-5652", | |
2756 | + reiserfs_panic(sb, "vs-5652", | |
2757 | "item must be indirect %h", le_ih); | |
2758 | ||
2759 | if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE) | |
2760 | - reiserfs_panic(p_s_sb, "vs-5653", "completing " | |
2761 | + reiserfs_panic(sb, "vs-5653", "completing " | |
2762 | "indirect2direct conversion indirect " | |
2763 | "item %h being deleted must be of " | |
2764 | "4 byte long", le_ih); | |
2765 | ||
2766 | if (c_mode == M_CUT | |
2767 | && s_cut_balance.insert_size[0] != -UNFM_P_SIZE) { | |
2768 | - reiserfs_panic(p_s_sb, "vs-5654", "can not complete " | |
2769 | + reiserfs_panic(sb, "vs-5654", "can not complete " | |
2770 | "indirect2direct conversion of %h " | |
2771 | "(CUT, insert_size==%d)", | |
2772 | le_ih, s_cut_balance.insert_size[0]); | |
2773 | --- a/fs/reiserfs/tail_conversion.c | |
2774 | +++ b/fs/reiserfs/tail_conversion.c | |
2775 | @@ -175,9 +175,9 @@ int indirect2direct(struct reiserfs_tran | |
2776 | loff_t n_new_file_size, /* New file size. */ | |
2777 | char *p_c_mode) | |
2778 | { | |
2779 | - struct super_block *p_s_sb = p_s_inode->i_sb; | |
2780 | + struct super_block *sb = p_s_inode->i_sb; | |
2781 | struct item_head s_ih; | |
2782 | - unsigned long n_block_size = p_s_sb->s_blocksize; | |
2783 | + unsigned long n_block_size = sb->s_blocksize; | |
2784 | char *tail; | |
2785 | int tail_len, round_tail_len; | |
2786 | loff_t pos, pos1; /* position of first byte of the tail */ | |
2787 | @@ -185,7 +185,7 @@ int indirect2direct(struct reiserfs_tran | |
2788 | ||
2789 | BUG_ON(!th->t_trans_id); | |
2790 | ||
2791 | - REISERFS_SB(p_s_sb)->s_indirect2direct++; | |
2792 | + REISERFS_SB(sb)->s_indirect2direct++; | |
2793 | ||
2794 | *p_c_mode = M_SKIP_BALANCING; | |
2795 | ||
2796 | @@ -200,7 +200,7 @@ int indirect2direct(struct reiserfs_tran | |
2797 | ||
2798 | pos = | |
2799 | le_ih_k_offset(&s_ih) - 1 + (ih_item_len(&s_ih) / UNFM_P_SIZE - | |
2800 | - 1) * p_s_sb->s_blocksize; | |
2801 | + 1) * sb->s_blocksize; | |
2802 | pos1 = pos; | |
2803 | ||
2804 | // we are protected by i_mutex. The tail can not disapper, not | |
2805 | @@ -211,18 +211,18 @@ int indirect2direct(struct reiserfs_tran | |
2806 | ||
2807 | if (path_changed(&s_ih, p_s_path)) { | |
2808 | /* re-search indirect item */ | |
2809 | - if (search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path) | |
2810 | + if (search_for_position_by_key(sb, p_s_item_key, p_s_path) | |
2811 | == POSITION_NOT_FOUND) | |
2812 | - reiserfs_panic(p_s_sb, "PAP-5520", | |
2813 | + reiserfs_panic(sb, "PAP-5520", | |
2814 | "item to be converted %K does not exist", | |
2815 | p_s_item_key); | |
2816 | copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); | |
2817 | #ifdef CONFIG_REISERFS_CHECK | |
2818 | pos = le_ih_k_offset(&s_ih) - 1 + | |
2819 | (ih_item_len(&s_ih) / UNFM_P_SIZE - | |
2820 | - 1) * p_s_sb->s_blocksize; | |
2821 | + 1) * sb->s_blocksize; | |
2822 | if (pos != pos1) | |
2823 | - reiserfs_panic(p_s_sb, "vs-5530", "tail position " | |
2824 | + reiserfs_panic(sb, "vs-5530", "tail position " | |
2825 | "changed while we were reading it"); | |
2826 | #endif | |
2827 | } | |
2828 | --- a/include/linux/reiserfs_fs.h | |
2829 | +++ b/include/linux/reiserfs_fs.h | |
2830 | @@ -1769,12 +1769,12 @@ int journal_end_sync(struct reiserfs_tra | |
2831 | int journal_mark_freed(struct reiserfs_transaction_handle *, | |
2832 | struct super_block *, b_blocknr_t blocknr); | |
2833 | int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); | |
2834 | -int reiserfs_in_journal(struct super_block *p_s_sb, unsigned int bmap_nr, | |
2835 | - int bit_nr, int searchall, b_blocknr_t *next); | |
2836 | +int reiserfs_in_journal(struct super_block *sb, unsigned int bmap_nr, | |
2837 | + int bit_nr, int searchall, b_blocknr_t *next); | |
2838 | int journal_begin(struct reiserfs_transaction_handle *, | |
2839 | - struct super_block *p_s_sb, unsigned long); | |
2840 | + struct super_block *sb, unsigned long); | |
2841 | int journal_join_abort(struct reiserfs_transaction_handle *, | |
2842 | - struct super_block *p_s_sb, unsigned long); | |
2843 | + struct super_block *sb, unsigned long); | |
2844 | void reiserfs_abort_journal(struct super_block *sb, int errno); | |
2845 | void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...); | |
2846 | int reiserfs_allocate_list_bitmaps(struct super_block *s, | |
2847 | @@ -1830,11 +1830,11 @@ static inline void copy_key(struct reise | |
2848 | ||
2849 | int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path); | |
2850 | const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, | |
2851 | - const struct super_block *p_s_sb); | |
2852 | + const struct super_block *sb); | |
2853 | int search_by_key(struct super_block *, const struct cpu_key *, | |
2854 | struct treepath *, int); | |
2855 | #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) | |
2856 | -int search_for_position_by_key(struct super_block *p_s_sb, | |
2857 | +int search_for_position_by_key(struct super_block *sb, | |
2858 | const struct cpu_key *p_s_cpu_key, | |
2859 | struct treepath *p_s_search_path); | |
2860 | extern void decrement_bcount(struct buffer_head *p_s_bh); | |
2861 | @@ -1978,7 +1978,7 @@ int reiserfs_global_version_in_proc(char | |
2862 | #define PROC_INFO_MAX( sb, field, value ) VOID_V | |
2863 | #define PROC_INFO_INC( sb, field ) VOID_V | |
2864 | #define PROC_INFO_ADD( sb, field, val ) VOID_V | |
2865 | -#define PROC_INFO_BH_STAT( p_s_sb, p_s_bh, n_node_level ) VOID_V | |
2866 | +#define PROC_INFO_BH_STAT(sb, p_s_bh, n_node_level) VOID_V | |
2867 | #endif | |
2868 | ||
2869 | /* dir.c */ |