summaryrefslogtreecommitdiff
path: root/e2fsck/problem.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2015-04-01 19:34:40 -0700
committerTheodore Ts'o <tytso@mit.edu>2015-04-21 16:22:59 -0400
commite228d700d5b59d2d2e0e3a54c4c76b66ed71afdf (patch)
treeff12ae8e5554d80ece36ddd263132c28a2416abe /e2fsck/problem.h
parenta5abfe0382729fba2c5fea6aaae486cb8bc98f00 (diff)
downloade2fsprogs-e228d700d5b59d2d2e0e3a54c4c76b66ed71afdf.tar.gz
e2fsck: rebuild sparse extent trees & convert non-extent ext3 files
Teach e2fsck to (re)construct extent trees. This enables us to do either of the following: compress a highly sparse extent tree into fewer ETB blocks; or convert a ext3-style block mapped file to an extent file. The reconstruction is performed during pass 1E or 3A, as detailed below. For files that are already extent based, this algorithm will automatically run (pending user approval) if pass1 determines either (1) that a whole level of extent tree will fit into a higher level of the tree; (2) that the size of any level can be reduced by at least one ETB block; or (3) the extent tree is unnecessarily deep. It will not run at all if errors are found and the user declines to fix the errors. The option "-E bmap2extent" can be used to force e2fsck to convert all block map files to extent trees, and to rebuild all extent files' extent trees. After conversion, files larger than 12 blocks should be defragmented to eliminate empty holes where a block lives. The extent tree constructor is pretty dumb -- it creates a list of leaf extents (adjacent extents are collapsed), marks all indirect blocks / ETB blocks free, installs a new extent tree root in the inode, then loads the leaf extents into the tree. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/problem.h')
-rw-r--r--e2fsck/problem.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/e2fsck/problem.h b/e2fsck/problem.h
index bc959c48..24260217 100644
--- a/e2fsck/problem.h
+++ b/e2fsck/problem.h
@@ -40,6 +40,7 @@ struct problem_context {
#define PR_LATCH_TOOBIG 0x0080 /* Latch for file to big errors */
#define PR_LATCH_OPTIMIZE_DIR 0x0090 /* Latch for optimize directories */
#define PR_LATCH_BG_CHECKSUM 0x00A0 /* Latch for block group checksums */
+#define PR_LATCH_OPTIMIZE_EXT 0x00B0 /* Latch for rebuild extents */
#define PR_LATCH(x) ((((x) & PR_LATCH_MASK) >> 4) - 1)
@@ -644,6 +645,9 @@ struct problem_context {
/* Error allocating memory for encrypted directory list */
#define PR_1_ALLOCATE_ENCRYPTED_DIRLIST 0x01007E
+/* extent tree max depth too big */
+#define PR_1_EXTENT_BAD_MAX_DEPTH 0x01007F
+
/*
* Pass 1b errors
*/
@@ -707,6 +711,33 @@ struct problem_context {
#define PR_1D_CLONE_ERROR 0x013008
/*
+ * Pass 1e --- rebuilding extent trees
+ */
+/* Pass 1e: Rebuilding extent trees */
+#define PR_1E_PASS_HEADER 0x014000
+
+/* Error rehash directory */
+#define PR_1E_OPTIMIZE_EXT_ERR 0x014001
+
+/* Rebuilding extent trees */
+#define PR_1E_OPTIMIZE_EXT_HEADER 0x014002
+
+/* Rebuilding extent %d */
+#define PR_1E_OPTIMIZE_EXT 0x014003
+
+/* Rebuilding extent tree end */
+#define PR_1E_OPTIMIZE_EXT_END 0x014004
+
+/* Internal error: extent tree depth too large */
+#define PR_1E_MAX_EXTENT_TREE_DEPTH 0x014005
+
+/* Inode extent tree could be shorter */
+#define PR_1E_CAN_COLLAPSE_EXTENT_TREE 0x014006
+
+/* Inode extent tree could be narrower */
+#define PR_1E_CAN_NARROW_EXTENT_TREE 0x014007
+
+/*
* Pass 2 errors
*/
@@ -1035,6 +1066,8 @@ struct problem_context {
/* Rehashing dir end */
#define PR_3A_OPTIMIZE_DIR_END 0x031005
+/* Pass 3B is really just 1E */
+
/*
* Pass 4 errors
*/