License notice (GPLv2+); comments about the bad blocks
parent
8cc74f4f27
commit
553e1273ea
|
@ -2,6 +2,25 @@
|
|||
* A tool for ext2/ext3/ext4 filesystems that allows to change inode count
|
||||
* without recreating it.
|
||||
*
|
||||
* Copyright (c) Vitaliy Filippov <vitalif@mail.ru> 2014
|
||||
* License: GNU GPLv2 or later
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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),
|
||||
|
@ -15,13 +34,13 @@
|
|||
* 2.1) Create a map of blocks that we want to free
|
||||
* 2.2) Iterate through all inodes and move remembered blocks.
|
||||
* It involves overwriting the whole file extent tree or block mapping...
|
||||
* If some of these blocks are in the bad block inode, we should either
|
||||
* abort the reallocation process, or move inode tables to another location
|
||||
* in a block group, possibly first defragmenting it... :-(
|
||||
* If some of these blocks are in the bad block inode, abort the reallocation process.
|
||||
* We could possibly try to move inode tables to another location in a block group
|
||||
* in that case; but it may be needed to defragment it first... :-(
|
||||
* 3) Change all inode numbers in directory entries according to mappings from (1.2),
|
||||
* and then using a formula: new_num = 1 + ((old_num-1)/old_i_per_g)*new_i_per_g + ((old_num-1) % old_i_per_g)
|
||||
* 4) Move parts of inode tables so they are consecutive again if flex_bg feature is active
|
||||
* 5) Mark/unmark extra blocks for inode tables
|
||||
* 5) Mark/unmark extra blocks used for inode tables
|
||||
* 6) Change block group descriptors: bg_inode_table, bg_free_inodes_count,
|
||||
* bg_free_blocks_count, bg_inode_bitmap_csum, bg_itable_unused
|
||||
* 7) Change superblock: s_inodes_count, s_free_blocks_count,
|
||||
|
|
Loading…
Reference in New Issue