aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2021-07-12 17:43:15 +0200
committerTheodore Ts'o <tytso@mit.edu>2021-08-03 14:25:03 -0400
commit66fe42db7ae4657075971f70cf99f128de1d37cc (patch)
tree4ab2f552472500ff5624d2bfec2b1c3d892a87e9
parent917dbe697f9258329f70a19ae02567dc441e69cd (diff)
downloade2fsprogs-pu.tar.gz
dumpe2fs, debugfs, e2image: Add support for orphan filepu
Print inode number of orphan file in outputs, dump e2image file to filesystem image. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--debugfs/set_fields.c1
-rw-r--r--lib/e2p/ls.c3
-rw-r--r--misc/e2image.c3
3 files changed, 6 insertions, 1 deletions
diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c
index b00157940..f916deab8 100644
--- a/debugfs/set_fields.c
+++ b/debugfs/set_fields.c
@@ -183,6 +183,7 @@ static struct field_set_info super_fields[] = {
{ "lpf_ino", &set_sb.s_lpf_ino, NULL, 4, parse_uint },
{ "checksum_seed", &set_sb.s_checksum_seed, NULL, 4, parse_uint },
{ "encoding", &set_sb.s_encoding, NULL, 2, parse_encoding },
+ { "orphan_file_inum", &set_sb.s_orphan_file_inum, NULL, 4, parse_uint },
{ 0, 0, 0, 0 }
};
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c
index 176bee0fd..1762bc44c 100644
--- a/lib/e2p/ls.c
+++ b/lib/e2p/ls.c
@@ -482,6 +482,9 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
if (ext2fs_has_feature_casefold(sb))
fprintf(f, "Character encoding: %s\n",
e2p_encoding2str(sb->s_encoding));
+ if (ext2fs_has_feature_orphan_file(sb))
+ fprintf(f, "Orphan file inode: %u\n",
+ sb->s_orphan_file_inum);
}
void list_super (struct ext2_super_block * s)
diff --git a/misc/e2image.c b/misc/e2image.c
index 0053b5156..2c1f3db33 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -1370,7 +1370,8 @@ static void write_raw_image_file(ext2_filsys fs, int fd, int type, int flags,
ino == fs->super->s_journal_inum ||
ino == quota_type2inum(USRQUOTA, fs->super) ||
ino == quota_type2inum(GRPQUOTA, fs->super) ||
- ino == quota_type2inum(PRJQUOTA, fs->super)) {
+ ino == quota_type2inum(PRJQUOTA, fs->super) ||
+ ino == fs->super->s_orphan_file_inum) {
retval = ext2fs_block_iterate3(fs, ino,
BLOCK_FLAG_READ_ONLY, block_buf,
process_dir_block, &pb);