aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/ext2fs/closefs.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/ext2fs/closefs.c')
-rw-r--r--e2fsprogs/ext2fs/closefs.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/e2fsprogs/ext2fs/closefs.c b/e2fsprogs/ext2fs/closefs.c
index 23e6332db..da0016b0e 100644
--- a/e2fsprogs/ext2fs/closefs.c
+++ b/e2fsprogs/ext2fs/closefs.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * closefs.c --- close an ext2 filesystem 2 * closefs.c --- close an ext2 filesystem
3 * 3 *
4 * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. 4 * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
5 * 5 *
6 * %Begin-Header% 6 * %Begin-Header%
@@ -45,7 +45,7 @@ int ext2fs_bg_has_super(ext2_filsys fs, int group_block)
45 return 0; 45 return 0;
46} 46}
47 47
48int ext2fs_super_and_bgd_loc(ext2_filsys fs, 48int ext2fs_super_and_bgd_loc(ext2_filsys fs,
49 dgrp_t group, 49 dgrp_t group,
50 blk_t *ret_super_blk, 50 blk_t *ret_super_blk,
51 blk_t *ret_old_desc_blk, 51 blk_t *ret_old_desc_blk,
@@ -63,7 +63,7 @@ int ext2fs_super_and_bgd_loc(ext2_filsys fs,
63 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) 63 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
64 old_desc_blocks = fs->super->s_first_meta_bg; 64 old_desc_blocks = fs->super->s_first_meta_bg;
65 else 65 else
66 old_desc_blocks = 66 old_desc_blocks =
67 fs->desc_blocks + fs->super->s_reserved_gdt_blocks; 67 fs->desc_blocks + fs->super->s_reserved_gdt_blocks;
68 68
69 if (group == fs->group_desc_count-1) { 69 if (group == fs->group_desc_count-1) {
@@ -100,7 +100,7 @@ int ext2fs_super_and_bgd_loc(ext2_filsys fs,
100 numblocks--; 100 numblocks--;
101 } 101 }
102 } 102 }
103 103
104 numblocks -= 2 + fs->inode_blocks_per_group; 104 numblocks -= 2 + fs->inode_blocks_per_group;
105 105
106 if (ret_super_blk) 106 if (ret_super_blk)
@@ -188,7 +188,7 @@ static errcode_t write_backup_super(ext2_filsys fs, dgrp_t group,
188 struct ext2_super_block *super_shadow) 188 struct ext2_super_block *super_shadow)
189{ 189{
190 dgrp_t sgrp = group; 190 dgrp_t sgrp = group;
191 191
192 if (sgrp > ((1 << 16) - 1)) 192 if (sgrp > ((1 << 16) - 1))
193 sgrp = (1 << 16) - 1; 193 sgrp = (1 << 16) - 1;
194#ifdef EXT2FS_ENABLE_SWAPFS 194#ifdef EXT2FS_ENABLE_SWAPFS
@@ -198,7 +198,7 @@ static errcode_t write_backup_super(ext2_filsys fs, dgrp_t group,
198#endif 198#endif
199 fs->super->s_block_group_nr = sgrp; 199 fs->super->s_block_group_nr = sgrp;
200 200
201 return io_channel_write_blk(fs->io, group_block, -SUPERBLOCK_SIZE, 201 return io_channel_write_blk(fs->io, group_block, -SUPERBLOCK_SIZE,
202 super_shadow); 202 super_shadow);
203} 203}
204 204
@@ -217,7 +217,7 @@ errcode_t ext2fs_flush(ext2_filsys fs)
217 dgrp_t j; 217 dgrp_t j;
218 struct ext2_group_desc *s, *t; 218 struct ext2_group_desc *s, *t;
219#endif 219#endif
220 220
221 EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); 221 EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
222 222
223 fs_state = fs->super->s_state; 223 fs_state = fs->super->s_state;
@@ -252,7 +252,7 @@ errcode_t ext2fs_flush(ext2_filsys fs)
252 super_shadow = fs->super; 252 super_shadow = fs->super;
253 group_shadow = fs->group_desc; 253 group_shadow = fs->group_desc;
254#endif 254#endif
255 255
256 /* 256 /*
257 * If this is an external journal device, don't write out the 257 * If this is an external journal device, don't write out the
258 * block group descriptors or any of the backup superblocks 258 * block group descriptors or any of the backup superblocks
@@ -289,7 +289,7 @@ errcode_t ext2fs_flush(ext2_filsys fs)
289 blk_t super_blk, old_desc_blk, new_desc_blk; 289 blk_t super_blk, old_desc_blk, new_desc_blk;
290 int meta_bg; 290 int meta_bg;
291 291
292 ext2fs_super_and_bgd_loc(fs, i, &super_blk, &old_desc_blk, 292 ext2fs_super_and_bgd_loc(fs, i, &super_blk, &old_desc_blk,
293 &new_desc_blk, &meta_bg); 293 &new_desc_blk, &meta_bg);
294 294
295 if (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) &&i && super_blk) { 295 if (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) &&i && super_blk) {
@@ -300,7 +300,7 @@ errcode_t ext2fs_flush(ext2_filsys fs)
300 } 300 }
301 if (fs->flags & EXT2_FLAG_SUPER_ONLY) 301 if (fs->flags & EXT2_FLAG_SUPER_ONLY)
302 continue; 302 continue;
303 if ((old_desc_blk) && 303 if ((old_desc_blk) &&
304 (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) || (i == 0))) { 304 (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) || (i == 0))) {
305 retval = io_channel_write_blk(fs->io, 305 retval = io_channel_write_blk(fs->io,
306 old_desc_blk, old_desc_blocks, group_ptr); 306 old_desc_blk, old_desc_blocks, group_ptr);
@@ -365,7 +365,7 @@ errout:
365errcode_t ext2fs_close(ext2_filsys fs) 365errcode_t ext2fs_close(ext2_filsys fs)
366{ 366{
367 errcode_t retval; 367 errcode_t retval;
368 368
369 EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); 369 EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
370 370
371 if (fs->flags & EXT2_FLAG_DIRTY) { 371 if (fs->flags & EXT2_FLAG_DIRTY) {