Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Make the e2fsck man page clear that the -c, -l, and -L options are
[tools/e2fsprogs.git]
/
e2fsck
/
e2fsck.c
diff --git
a/e2fsck/e2fsck.c
b/e2fsck/e2fsck.c
index
41195fe
..
7d2ccf6
100644
(file)
--- a/
e2fsck/e2fsck.c
+++ b/
e2fsck/e2fsck.c
@@
-21,15
+21,22
@@
errcode_t e2fsck_allocate_context(e2fsck_t *ret)
{
e2fsck_t context;
errcode_t retval;
+ char *time_env;
- retval = ext2fs_get_mem(sizeof(struct e2fsck_struct),
- (void **) &context);
+ retval = ext2fs_get_mem(sizeof(struct e2fsck_struct), &context);
if (retval)
return retval;
memset(context, 0, sizeof(struct e2fsck_struct));
context->process_inode_size = 256;
+ context->ext_attr_ver = 2;
+
+ time_env = getenv("E2FSCK_TIME");
+ if (time_env)
+ context->now = strtoul(time_env, NULL, 0);
+ else
+ context->now = time(0);
*ret = context;
return 0;
@@
-42,6
+49,8
@@
errcode_t e2fsck_allocate_context(e2fsck_t *ret)
errcode_t e2fsck_reset_context(e2fsck_t ctx)
{
ctx->flags = 0;
+ ctx->lost_and_found = 0;
+ ctx->bad_lost_and_found = 0;
if (ctx->inode_used_map) {
ext2fs_free_inode_bitmap(ctx->inode_used_map);
ctx->inode_used_map = 0;
@@
-50,6
+59,10
@@
errcode_t e2fsck_reset_context(e2fsck_t ctx)
ext2fs_free_inode_bitmap(ctx->inode_dir_map);
ctx->inode_dir_map = 0;
}
+ if (ctx->inode_reg_map) {
+ ext2fs_free_inode_bitmap(ctx->inode_reg_map);
+ ctx->inode_reg_map = 0;
+ }
if (ctx->block_found_map) {
ext2fs_free_block_bitmap(ctx->block_found_map);
ctx->block_found_map = 0;
@@
-58,15
+71,35
@@
errcode_t e2fsck_reset_context(e2fsck_t ctx)
ext2fs_free_icount(ctx->inode_link_info);
ctx->inode_link_info = 0;
}
- if (ctx->fs->dblist) {
+ if (ctx->journal_io) {
+ if (ctx->fs && ctx->fs->io != ctx->journal_io)
+ io_channel_close(ctx->journal_io);
+ ctx->journal_io = 0;
+ }
+ if (ctx->fs && ctx->fs->dblist) {
ext2fs_free_dblist(ctx->fs->dblist);
ctx->fs->dblist = 0;
}
e2fsck_free_dir_info(ctx);
+#ifdef ENABLE_HTREE
+ e2fsck_free_dx_dir_info(ctx);
+#endif
+ if (ctx->refcount) {
+ ea_refcount_free(ctx->refcount);
+ ctx->refcount = 0;
+ }
+ if (ctx->refcount_extra) {
+ ea_refcount_free(ctx->refcount_extra);
+ ctx->refcount_extra = 0;
+ }
if (ctx->block_dup_map) {
ext2fs_free_block_bitmap(ctx->block_dup_map);
ctx->block_dup_map = 0;
}
+ if (ctx->block_ea_map) {
+ ext2fs_free_block_bitmap(ctx->block_ea_map);
+ ctx->block_ea_map = 0;
+ }
if (ctx->inode_bb_map) {
ext2fs_free_inode_bitmap(ctx->inode_bb_map);
ctx->inode_bb_map = 0;
@@
-75,20
+108,28
@@
errcode_t e2fsck_reset_context(e2fsck_t ctx)
ext2fs_free_inode_bitmap(ctx->inode_bad_map);
ctx->inode_bad_map = 0;
}
+ if (ctx->inode_imagic_map) {
+ ext2fs_free_inode_bitmap(ctx->inode_imagic_map);
+ ctx->inode_imagic_map = 0;
+ }
+ if (ctx->dirs_to_hash) {
+ ext2fs_u32_list_free(ctx->dirs_to_hash);
+ ctx->dirs_to_hash = 0;
+ }
/*
* Clear the array of invalid meta-data flags
*/
if (ctx->invalid_inode_bitmap_flag) {
- ext2fs_free_mem(
(void **)
&ctx->invalid_inode_bitmap_flag);
+ ext2fs_free_mem(&ctx->invalid_inode_bitmap_flag);
ctx->invalid_inode_bitmap_flag = 0;
}
if (ctx->invalid_block_bitmap_flag) {
- ext2fs_free_mem(
(void **)
&ctx->invalid_block_bitmap_flag);
+ ext2fs_free_mem(&ctx->invalid_block_bitmap_flag);
ctx->invalid_block_bitmap_flag = 0;
}
if (ctx->invalid_inode_table_flag) {
- ext2fs_free_mem(
(void **)
&ctx->invalid_inode_table_flag);
+ ext2fs_free_mem(&ctx->invalid_inode_table_flag);
ctx->invalid_inode_table_flag = 0;
}
@@
-122,8
+163,10
@@
void e2fsck_free_context(e2fsck_t ctx)
return;
e2fsck_reset_context(ctx);
-
- ext2fs_free_mem((void **) &ctx);
+ if (ctx->blkid)
+ blkid_put_cache(ctx->blkid);
+
+ ext2fs_free_mem(&ctx);
}
/*
@@
-144,8
+187,10
@@
int e2fsck_run(e2fsck_t ctx)
pass_t e2fsck_pass;
#ifdef HAVE_SETJMP_H
- if (setjmp(ctx->abort_loc))
+ if (setjmp(ctx->abort_loc)) {
+ ctx->flags &= ~E2F_FLAG_SETJMP_OK;
return (ctx->flags & E2F_FLAG_RUN_RETURN);
+ }
ctx->flags |= E2F_FLAG_SETJMP_OK;
#endif
@@
-153,6
+198,8
@@
int e2fsck_run(e2fsck_t ctx)
if (ctx->flags & E2F_FLAG_RUN_RETURN)
break;
e2fsck_pass(ctx);
+ if (ctx->progress)
+ (void) (ctx->progress)(ctx, 0, 0, 0);
}
ctx->flags &= ~E2F_FLAG_SETJMP_OK;
@@
-160,9
+207,3
@@
int e2fsck_run(e2fsck_t ctx)
return (ctx->flags & E2F_FLAG_RUN_RETURN);
return 0;
}
-
-
-
-
-
-