fsck.gfs2: Combine block and char device inode types
PATCH 42/44 fsck.gfs2: Combine block and char device inode types
From 993b62468d4d58220927f72a1fc01b04ebd75da5 Mon Sep 17 00:00:00 2001
From: Bob Peterson <[email protected]>
Date: Thu, 11 Aug 2011 09:16:33 -0500
Subject: [PATCH 42/44] fsck.gfs2: Combine block and char device inode types
This patch combines the block and character device block designations. Devices are now treated equally as one block type, which is fine. This buys back a block type in the block map which may be used later for gfs1 support. It also eliminates the rgrp block designation, which is not needed: We only need to know whether rgrp blocks are "in use" or not. In fact, the rgrp blocks have special processing anyway and special code (function valid_block) to check for overlaps.
rhbz#675723
--- gfs2/fsck/pass1.c | 6 +++--- gfs2/fsck/pass2.c | 8 ++------ gfs2/fsck/pass3.c | 5 ++--- gfs2/fsck/pass4.c | 3 +-- gfs2/fsck/pass5.c | 4 +--- gfs2/fsck/util.h | 50 +++++++++++++++++++++++++------------------------- 6 files changed, 34 insertions(+), 42 deletions(-)
gfs2/fsck/pass1.c +3 -3
@@ -1149,12 +1149,12 @@ static int handle_ip(struct gfs2_sbd *sdp, struct gfs2_inode *ip)break ;case S_IFBLK :if (fsck_blockmap_set (ip, block,_ ("block device" ), - gfs2_inode_blk)) + gfs2_inode_device)) goto bad_dinode;break ;case S_IFCHR :if (fsck_blockmap_set (ip, block,_ ("character device" ), - gfs2_inode_chr)) + gfs2_inode_device)) goto bad_dinode;break ;case S_IFIFO :
@@ -1553,7 +1553,7 @@ int pass1(struct gfs2_sbd *sdp) "is now marked as 'rgrp data'\n"), rgd->ri.ri_addr + i, rgd->ri.ri_addr + i);if (gfs2_blockmap_set (bl, rgd->ri.ri_addr + i, - gfs2_meta_rgrp)) { + gfs2_indir_blk)) { stack;return FSCK_ERROR ; }
gfs2/fsck/pass2.c +2 -6
@@ -138,12 +138,8 @@ static int check_file_type(uint8_t de_type, uint8_t blk_type)if (de_type !=DT_LNK )return 1 ;break ; -case gfs2_inode_blk: -if (de_type !=DT_BLK ) -return 1 ; -break ; -case gfs2_inode_chr: -if (de_type !=DT_CHR ) +case gfs2_inode_device: +if (de_type !=DT_BLK && de_type !=DT_CHR )return 1 ;break ;case gfs2_inode_fifo:
gfs2/fsck/pass3.c +2 -3
@@ -247,9 +247,8 @@ int pass3(struct gfs2_sbd *sdp)log_err (_ ("Unlinked directory with bad block remains\n" )); } if (q != gfs2_inode_dir && q != gfs2_inode_file && - q != gfs2_inode_lnk && q != gfs2_inode_blk && - q != gfs2_inode_chr && q != gfs2_inode_fifo && - q != gfs2_inode_sock) { + q != gfs2_inode_lnk && q != gfs2_inode_device && + q != gfs2_inode_fifo && q != gfs2_inode_sock) { log_err( _("Unlinked block marked as an inode " "is not an inode\n")); if (!query(_("Clear the unlinked block?"
gfs2/fsck/pass4.c +1 -2
@@ -85,8 +85,7 @@ static int scan_inode_list(struct gfs2_sbd *sdp) {if (q != gfs2_inode_dir && q != gfs2_inode_file && q != gfs2_inode_lnk && - q != gfs2_inode_blk && - q != gfs2_inode_chr && + q != gfs2_inode_device && q != gfs2_inode_fifo && q != gfs2_inode_sock) { log_err( _("Unlinked block %lld (0x%llx) "
gfs2/fsck/pass5.c +1 -3
@@ -29,8 +29,7 @@ static int convert_mark(uint8_t q, uint32_t *count)case gfs2_inode_dir:case gfs2_inode_file:case gfs2_inode_lnk: -case gfs2_inode_blk: -case gfs2_inode_chr: +case gfs2_inode_device:case gfs2_inode_fifo:case gfs2_inode_sock: count[1 ]++;
@@ -38,7 +37,6 @@ static int convert_mark(uint8_t q, uint32_t *count)case gfs2_indir_blk:case gfs2_leaf_blk: -case gfs2_meta_rgrp:case gfs2_meta_eattr: count[2 ]++;return GFS2_BLKST_USED ;
gfs2/fsck/util.h +25 -25
80 lines not on this page · raw message
Signature · 1 line
1.7.4.4