cleanup: run indent with the Linux Kernel style across all code
Over the years, the reiserfs kernel code has been gradually cleaned up to be more readable. This patch does the same to the progs code. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
1 parent
b23d40f723
commit
47cff72748
51 files changed
+27279
-25108
No files matched your search
+66
-65
@@ -5,86 +5,87 @@
|
||||
|
||||
#include "fsck.h"
|
||||
|
||||
void pass_4_check_unaccessed_items (void)
|
||||
void pass_4_check_unaccessed_items(void)
|
||||
{
|
||||
struct reiserfs_key key;
|
||||
struct reiserfs_path path;
|
||||
int i;
|
||||
struct buffer_head * bh;
|
||||
struct item_head * ih;
|
||||
unsigned long items;
|
||||
struct reiserfs_key *rdkey;
|
||||
struct reiserfs_key key;
|
||||
struct reiserfs_path path;
|
||||
int i;
|
||||
struct buffer_head *bh;
|
||||
struct item_head *ih;
|
||||
unsigned long items;
|
||||
struct reiserfs_key *rdkey;
|
||||
|
||||
path.path_length = ILLEGAL_PATH_ELEMENT_OFFSET;
|
||||
key = root_dir_key;
|
||||
|
||||
fsck_progress ("Pass 4 - ");
|
||||
items = 0;
|
||||
path.path_length = ILLEGAL_PATH_ELEMENT_OFFSET;
|
||||
key = root_dir_key;
|
||||
|
||||
while (reiserfs_search_by_key_4 (fs, &key, &path) == ITEM_FOUND) {
|
||||
bh = PATH_PLAST_BUFFER (&path);
|
||||
fsck_progress("Pass 4 - ");
|
||||
items = 0;
|
||||
|
||||
/* print ~ how many leaves were scanned and how fast it was */
|
||||
if (!fsck_quiet (fs))
|
||||
print_how_fast (items++, 0, 50, 0);
|
||||
while (reiserfs_search_by_key_4(fs, &key, &path) == ITEM_FOUND) {
|
||||
bh = PATH_PLAST_BUFFER(&path);
|
||||
|
||||
for (i = get_item_pos (&path), ih = get_ih (&path); i < B_NR_ITEMS (bh); i ++, ih ++) {
|
||||
if (!is_item_reachable (ih)) {
|
||||
PATH_LAST_POSITION (&path) = i;
|
||||
/* print ~ how many leaves were scanned and how fast it was */
|
||||
if (!fsck_quiet(fs))
|
||||
print_how_fast(items++, 0, 50, 0);
|
||||
|
||||
for (i = get_item_pos(&path), ih = get_ih(&path);
|
||||
i < B_NR_ITEMS(bh); i++, ih++) {
|
||||
if (!is_item_reachable(ih)) {
|
||||
PATH_LAST_POSITION(&path) = i;
|
||||
rdkey = reiserfs_next_key(&path);
|
||||
if (rdkey)
|
||||
key = *rdkey;
|
||||
else
|
||||
memset(&key, 0xff, KEY_SIZE);
|
||||
|
||||
pass_4_stat(fs)->deleted_items++;
|
||||
|
||||
reiserfsck_delete_item(&path, 0);
|
||||
|
||||
goto cont;
|
||||
}
|
||||
|
||||
if (get_ih_flags(ih) != 0) {
|
||||
clean_ih_flags(ih);
|
||||
mark_buffer_dirty(bh);
|
||||
}
|
||||
|
||||
}
|
||||
PATH_LAST_POSITION(&path) = i - 1;
|
||||
rdkey = reiserfs_next_key(&path);
|
||||
if (rdkey)
|
||||
key = *rdkey;
|
||||
key = *rdkey;
|
||||
else
|
||||
memset (&key, 0xff, KEY_SIZE);
|
||||
|
||||
pass_4_stat (fs)->deleted_items ++;
|
||||
|
||||
reiserfsck_delete_item (&path, 0);
|
||||
memset(&key, 0xff, KEY_SIZE);
|
||||
|
||||
goto cont;
|
||||
}
|
||||
|
||||
if (get_ih_flags(ih) != 0) {
|
||||
clean_ih_flags(ih);
|
||||
mark_buffer_dirty(bh);
|
||||
}
|
||||
|
||||
pathrelse(&path);
|
||||
|
||||
cont:
|
||||
/* to make gcc 3.2 do not sware here */ ;
|
||||
}
|
||||
PATH_LAST_POSITION(&path) = i - 1;
|
||||
rdkey = reiserfs_next_key (&path);
|
||||
if (rdkey)
|
||||
key = *rdkey;
|
||||
else
|
||||
memset (&key, 0xff, KEY_SIZE);
|
||||
|
||||
pathrelse (&path);
|
||||
|
||||
cont:
|
||||
/* to make gcc 3.2 do not sware here */;
|
||||
}
|
||||
pathrelse(&path);
|
||||
|
||||
pathrelse (&path);
|
||||
fsck_progress("finished\n");
|
||||
stage_report(4, fs);
|
||||
|
||||
fsck_progress ("finished\n");
|
||||
stage_report (4, fs);
|
||||
/* after pass 4 */
|
||||
|
||||
/* after pass 4 */
|
||||
/* put bitmap on place */
|
||||
reiserfs_bitmap_copy(fs->fs_bitmap2, fsck_new_bitmap(fs));
|
||||
|
||||
/* put bitmap on place */
|
||||
reiserfs_bitmap_copy (fs->fs_bitmap2, fsck_new_bitmap (fs));
|
||||
/* update super block */
|
||||
set_sb_free_blocks(fs->fs_ondisk_sb,
|
||||
reiserfs_bitmap_zeros(fsck_new_bitmap(fs)));
|
||||
mark_buffer_dirty(fs->fs_super_bh);
|
||||
|
||||
/* update super block */
|
||||
set_sb_free_blocks (fs->fs_ondisk_sb, reiserfs_bitmap_zeros (fsck_new_bitmap (fs)));
|
||||
mark_buffer_dirty (fs->fs_super_bh);
|
||||
/* write all dirty blocks */
|
||||
fsck_progress("Flushing..");
|
||||
fs->fs_dirt = 1;
|
||||
id_map_flush(proper_id_map(fs), fs);
|
||||
reiserfs_flush_to_ondisk_bitmap(fs->fs_bitmap2, fs);
|
||||
reiserfs_flush(fs);
|
||||
fsck_progress("finished\n");
|
||||
|
||||
/* write all dirty blocks */
|
||||
fsck_progress ("Flushing..");
|
||||
fs->fs_dirt = 1;
|
||||
id_map_flush(proper_id_map (fs), fs);
|
||||
reiserfs_flush_to_ondisk_bitmap (fs->fs_bitmap2, fs);
|
||||
reiserfs_flush (fs);
|
||||
fsck_progress ("finished\n");
|
||||
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user