tabs, todo

master
Vitaliy Filippov 2014-01-07 17:06:21 +00:00
parent 553e1273ea
commit 46fc23e2d1
2 changed files with 23 additions and 28 deletions

16
bmove.c
View File

@ -1,6 +1,5 @@
/*
* bmove.c --- Move blocks around to make way for a particular
* filesystem structure.
* bmove.c --- Move blocks around to make way for a particular filesystem structure.
*
* Copyright (C) 1997 Theodore Ts'o.
*
@ -80,8 +79,7 @@ static int process_block(ext2_filsys fs, blk64_t *block_nr,
(unsigned long long) block);
}
if (pb->add_dir) {
retval = ext2fs_add_dir_block2(fs->dblist, pb->ino,
block, blockcnt);
retval = ext2fs_add_dir_block2(fs->dblist, pb->ino, block, blockcnt);
if (retval) {
pb->error = retval;
ret |= BLOCK_ABORT;
@ -136,18 +134,15 @@ errcode_t ext2fs_move_blocks(ext2_filsys fs,
return retval;
while (ino) {
if ((inode.i_links_count == 0) ||
!ext2fs_inode_has_valid_blocks2(fs, &inode))
if ((inode.i_links_count == 0) || !ext2fs_inode_has_valid_blocks2(fs, &inode))
goto next;
pb.ino = ino;
pb.inode = &inode;
pb.add_dir = (LINUX_S_ISDIR(inode.i_mode) &&
flags & EXT2_BMOVE_GET_DBLIST);
pb.add_dir = (LINUX_S_ISDIR(inode.i_mode) && flags & EXT2_BMOVE_GET_DBLIST);
retval = ext2fs_block_iterate3(fs, ino, 0, block_buf,
process_block, &pb);
retval = ext2fs_block_iterate3(fs, ino, 0, block_buf, process_block, &pb);
if (retval)
return retval;
if (pb.error)
@ -160,4 +155,3 @@ errcode_t ext2fs_move_blocks(ext2_filsys fs,
}
return 0;
}

View File

@ -21,6 +21,7 @@
*/
/**
* TODO fix reallocation for the case when inode tables for flex_bg do not fit into a single block group
* TODO bigalloc compatibility
* TODO write some tests: for inode moving (image with many files),
* for block moving, including extent blocks (one sparse file with many extents),