• Home
  • Raw
  • Download

Lines Matching refs:fs

56 static int release_inode_block(ext2_filsys fs,  in release_inode_block()  argument
79 if ((blk < fs->super->s_first_data_block) || in release_inode_block()
80 (blk >= fs->super->s_blocks_count)) { in release_inode_block()
87 if (!ext2fs_test_block_bitmap(fs->block_map, blk)) { in release_inode_block()
106 pb->errcode = io_channel_read_blk(fs->io, blk, 1, in release_inode_block()
111 limit = fs->blocksize >> 2; in release_inode_block()
128 pb->errcode = io_channel_read_blk(fs->io, blk, 1, in release_inode_block()
133 fs->blocksize - pb->truncate_offset); in release_inode_block()
134 pb->errcode = io_channel_write_blk(fs->io, blk, 1, in release_inode_block()
144 ext2fs_block_alloc_stats(fs, blk, -1); in release_inode_block()
158 ext2_filsys fs = ctx->fs; in release_inode_blocks() local
165 pb.buf = block_buf + 3 * ctx->fs->blocksize; in release_inode_blocks()
174 inode->i_size + fs->blocksize - 1) / in release_inode_blocks()
175 fs->blocksize); in release_inode_blocks()
176 pb.truncate_offset = inode->i_size % fs->blocksize; in release_inode_blocks()
183 retval = ext2fs_block_iterate2(fs, ino, BLOCK_FLAG_DEPTH_TRAVERSE, in release_inode_blocks()
198 ext2fs_iblk_sub_blocks(fs, inode, pb.truncated_blocks); in release_inode_blocks()
201 retval = ext2fs_adjust_ea_refcount(fs, inode->i_file_acl, in release_inode_blocks()
214 ext2fs_block_alloc_stats(fs, inode->i_file_acl, -1); in release_inode_blocks()
226 ext2_filsys fs = ctx->fs; in release_orphan_inodes() local
232 if ((ino = fs->super->s_last_orphan) == 0) in release_orphan_inodes()
239 fs->super->s_last_orphan = 0; in release_orphan_inodes()
240 ext2fs_mark_super_dirty(fs); in release_orphan_inodes()
247 if (fs->super->s_state & EXT2_ERROR_FS) in release_orphan_inodes()
250 if ((ino < EXT2_FIRST_INODE(fs->super)) || in release_orphan_inodes()
251 (ino > fs->super->s_inodes_count)) { in release_orphan_inodes()
258 block_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize * 4, in release_orphan_inodes()
274 ((next_ino < EXT2_FIRST_INODE(fs->super)) || in release_orphan_inodes()
275 (next_ino > fs->super->s_inodes_count))) { in release_orphan_inodes()
285 ext2fs_inode_alloc_stats2(fs, ino, -1, in release_orphan_inodes()
309 ext2_filsys fs = ctx->fs; in check_resize_inode() local
324 if (!(fs->super->s_feature_compat & in check_resize_inode()
326 if (fs->super->s_reserved_gdt_blocks) { in check_resize_inode()
327 pctx.num = fs->super->s_reserved_gdt_blocks; in check_resize_inode()
330 fs->super->s_reserved_gdt_blocks = 0; in check_resize_inode()
331 ext2fs_mark_super_dirty(fs); in check_resize_inode()
338 retval = ext2fs_read_inode(fs, EXT2_RESIZE_INO, &inode); in check_resize_inode()
340 if (fs->super->s_feature_compat & in check_resize_inode()
350 if (!(fs->super->s_feature_compat & in check_resize_inode()
376 (blk < fs->super->s_first_data_block || in check_resize_inode()
377 blk >= fs->super->s_blocks_count)) { in check_resize_inode()
386 fs->super->s_state &= ~EXT2_VALID_FS; in check_resize_inode()
387 ext2fs_mark_super_dirty(fs); in check_resize_inode()
391 dind_buf = (__u32 *) e2fsck_allocate_memory(ctx, fs->blocksize * 2, in check_resize_inode()
393 ind_buf = (__u32 *) ((char *) dind_buf + fs->blocksize); in check_resize_inode()
395 retval = ext2fs_read_ind_block(fs, blk, dind_buf); in check_resize_inode()
399 gdt_off = fs->desc_blocks; in check_resize_inode()
400 pblk = fs->super->s_first_data_block + 1 + fs->desc_blocks; in check_resize_inode()
401 for (i = 0; i < fs->super->s_reserved_gdt_blocks / 4; in check_resize_inode()
403 gdt_off %= fs->blocksize/4; in check_resize_inode()
406 retval = ext2fs_read_ind_block(fs, pblk, ind_buf); in check_resize_inode()
410 for (j = 1; j < fs->group_desc_count; j++) { in check_resize_inode()
411 if (!ext2fs_bg_has_super(fs, j)) in check_resize_inode()
413 expect = pblk + (j * fs->super->s_blocks_per_group); in check_resize_inode()
431 struct ext2_super_block *sb = ctx->fs->super; in e2fsck_fix_dirhash_hint()
449 ext2fs_mark_super_dirty(ctx->fs); in e2fsck_fix_dirhash_hint()
456 ext2_filsys fs = ctx->fs; in check_super_block() local
458 struct ext2_super_block *sb = fs->super; in check_super_block()
461 blk_t blocks_per_group = fs->super->s_blocks_per_group; in check_super_block()
475 inodes_per_block = EXT2_INODES_PER_BLOCK(fs->super); in check_super_block()
484 sizeof(int) * fs->group_desc_count, "invalid_inode_bitmap"); in check_super_block()
486 sizeof(int) * fs->group_desc_count, "invalid_block_bitmap"); in check_super_block()
488 sizeof(int) * fs->group_desc_count, "invalid_inode_table"); in check_super_block()
517 fs->blocksize/4); in check_super_block()
525 EXT2_GOOD_OLD_INODE_SIZE, fs->blocksize); in check_super_block()
571 should_be = sb->s_inodes_per_group * fs->group_desc_count; in check_super_block()
577 ext2fs_mark_super_dirty(fs); in check_super_block()
587 csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in check_super_block()
589 for (i = 0, gd=fs->group_desc; i < fs->group_desc_count; i++, gd++) { in check_super_block()
592 if (!EXT2_HAS_INCOMPAT_FEATURE(fs->super, in check_super_block()
594 first_block = ext2fs_group_first_block(fs, i); in check_super_block()
595 last_block = ext2fs_group_last_block(fs, i); in check_super_block()
620 fs->inode_blocks_per_group - 1) > last_block)) { in check_super_block()
635 ext2fs_unmark_valid(fs); in check_super_block()
638 if (!ext2fs_group_desc_csum_verify(fs, i)) { in check_super_block()
645 ext2fs_unmark_valid(fs); in check_super_block()
657 ext2fs_unmark_valid(fs); in check_super_block()
660 if (i == fs->group_desc_count - 1 && in check_super_block()
666 ext2fs_unmark_valid(fs); in check_super_block()
675 ext2fs_unmark_valid(fs); in check_super_block()
686 ext2fs_unmark_valid(fs); in check_super_block()
690 ext2fs_group_desc_csum_set(fs, i); in check_super_block()
703 ext2fs_unmark_valid(fs); in check_super_block()
707 ext2fs_mark_super_dirty(fs); in check_super_block()
713 ext2fs_unmark_valid(fs); in check_super_block()
722 ext2fs_mark_super_dirty(fs); in check_super_block()
734 ext2fs_mark_super_dirty(fs); in check_super_block()
735 fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; in check_super_block()
748 (fs->super->s_flags & EXT2_FLAGS_TEST_FILESYS) && in check_super_block()
751 fs->super->s_flags &= ~EXT2_FLAGS_TEST_FILESYS; in check_super_block()
752 ext2fs_mark_super_dirty(fs); in check_super_block()
753 fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; in check_super_block()
762 fs->super->s_creator_os == EXT2_OS_HURD && in check_super_block()
763 (fs->super->s_feature_incompat & in check_super_block()
766 fs->super->s_feature_incompat &= in check_super_block()
768 ext2fs_mark_super_dirty(fs); in check_super_block()
769 fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; in check_super_block()
780 fs->super->s_rev_level == EXT2_GOOD_OLD_REV && in check_super_block()
781 (fs->super->s_feature_compat || in check_super_block()
782 fs->super->s_feature_ro_compat || in check_super_block()
783 fs->super->s_feature_incompat) && in check_super_block()
785 ext2fs_update_dynamic_rev(fs); in check_super_block()
786 ext2fs_mark_super_dirty(fs); in check_super_block()
787 fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; in check_super_block()
794 fs->super->s_state &= ~EXT2_VALID_FS; in check_super_block()
795 ext2fs_mark_super_dirty(fs); in check_super_block()
834 fs->super->s_mtime > (__u32) ctx->now) { in check_super_block()
835 pctx.num = fs->super->s_mtime; in check_super_block()
837 if (fs->super->s_mtime <= (__u32) ctx->now + ctx->time_fudge) in check_super_block()
840 fs->super->s_mtime = ctx->now; in check_super_block()
841 ext2fs_mark_super_dirty(fs); in check_super_block()
846 fs->super->s_wtime > (__u32) ctx->now) { in check_super_block()
847 pctx.num = fs->super->s_wtime; in check_super_block()
849 if (fs->super->s_wtime <= (__u32) ctx->now + ctx->time_fudge) in check_super_block()
852 fs->super->s_wtime = ctx->now; in check_super_block()
853 ext2fs_mark_super_dirty(fs); in check_super_block()
901 ext2_filsys fs = ctx->fs; in check_backup_super_block() local
916 if (((fs->flags & EXT2_FLAG_MASTER_SB_ONLY) == 0) || in check_backup_super_block()
917 !ext2fs_test_valid(fs) || in check_backup_super_block()
918 (fs->super->s_state & EXT2_ERROR_FS) || in check_backup_super_block()
923 for (g = 1; g < fs->group_desc_count; g++) { in check_backup_super_block()
924 if (!ext2fs_bg_has_super(fs, g)) in check_backup_super_block()
927 sb = fs->super->s_first_data_block + in check_backup_super_block()
928 (g * fs->super->s_blocks_per_group); in check_backup_super_block()
930 retval = io_channel_read_blk(fs->io, sb, -SUPERBLOCK_SIZE, in check_backup_super_block()
946 ((fs->super->x & ~FEATURE_INCOMPAT_IGNORE) != \ in check_backup_super_block()
949 ((fs->super->x & ~FEATURE_RO_COMPAT_IGNORE) != \ in check_backup_super_block()
952 (fs->super->x != backup_sb->x) in check_backup_super_block()
959 memcmp(fs->super->s_uuid, backup_sb->s_uuid, in check_backup_super_block()
960 sizeof(fs->super->s_uuid))) in check_backup_super_block()