Lines Matching refs:sb
81 bool getSuperBlock(const int blk_fd, struct ext4_super_block* sb) { in getSuperBlock() argument
87 if (read(blk_fd, sb, sizeof(*sb)) != sizeof(*sb)) { in getSuperBlock()
92 if (sb->s_magic != 0xEF53) { in getSuperBlock()
102 struct ext4_super_block sb; in setSbErrorBit() local
103 if (!getSuperBlock(blk_fd, &sb)) { in setSbErrorBit()
108 if (sb.s_state & 0x2) { in setSbErrorBit()
114 sb.s_state |= 0x2; in setSbErrorBit()
122 if (write(blk_fd, &sb, sizeof(sb)) != sizeof(sb)) { in setSbErrorBit()
132 struct ext4_super_block sb; in corruptGdtFreeBlock() local
133 if (!getSuperBlock(blk_fd, &sb)) { in corruptGdtFreeBlock()
137 if ((sb.s_log_block_size != 1) && (sb.s_log_block_size != 2)) { in corruptGdtFreeBlock()
141 int block_size = 1 << (10 + sb.s_log_block_size); in corruptGdtFreeBlock()
142 int num_bgs = DIV_ROUND_UP(sb.s_blocks_count_lo, sb.s_blocks_per_group); in corruptGdtFreeBlock()
144 if (sb.s_desc_size != sizeof(struct ext2_group_desc)) { in corruptGdtFreeBlock()
146 sb.s_desc_size); in corruptGdtFreeBlock()
312 struct ext4_super_block sb; in TEST_F() local
313 ASSERT_TRUE(ext4::getSuperBlock(getCacheBlkFd(), &sb)); in TEST_F()
315 ASSERT_FALSE(sb.s_state & 0x2); in TEST_F()