diff options
author | Theodore Ts'o <tytso@mit.edu> | 1997-11-03 19:42:40 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1997-11-03 19:42:40 +0000 |
commit | 08b213017f8371ce4b56ad4d368eb0f92211d04e (patch) | |
tree | 4ea99c73df01b238ac33cad38b6b955f330450ee /e2fsck/swapfs.c | |
parent | 79a90bdad033e101c38bb3c3207c8f4be47a2de7 (diff) | |
download | e2fsprogs-08b213017f8371ce4b56ad4d368eb0f92211d04e.tar.gz |
Many files:
Change ext2fs_read_inode, ext2fs_write_inode to take the e2fsck
context as their first argument.
Change dir_info.c routines to take an e2fsck_context, renamed them to
start with e2fsck_ to avoid namespace issues, and changed them to
store the directory information inside the e2fsck context.
Added e2fsck_run() which calls all of the e2fsck passes in the correct
order, and which handles the return of abort codes.
Added abort processing, both via setjmp/longjmp and via flags in the
e2fsck context.
Use a flag in the e2fsck context instead of the restart_e2fsck global
variable.
Change uses of free and malloc to ext2fs_free_mem and ext2fs_get_mem.
Diffstat (limited to 'e2fsck/swapfs.c')
-rw-r--r-- | e2fsck/swapfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/e2fsck/swapfs.c b/e2fsck/swapfs.c index f6d3d702..ab012c70 100644 --- a/e2fsck/swapfs.c +++ b/e2fsck/swapfs.c @@ -114,10 +114,10 @@ static void swap_inodes(e2fsck_t ctx) fs->read_inode = pass1_read_inode; fs->get_blocks = pass1_get_blocks; - - buf = malloc(fs->blocksize * fs->inode_blocks_per_group); - if (!buf) { - com_err("swap_inodes", ENOMEM, + retval = ext2fs_get_mem(fs->blocksize * fs->inode_blocks_per_group, + (void **) &buf); + if (retval) { + com_err("swap_inodes", retval, "while allocating inode buffer"); fatal_error(0); } @@ -168,8 +168,8 @@ static void swap_inodes(e2fsck_t ctx) fatal_error(0); } } - free(buf); - free(block_buf); + ext2fs_free_mem((void **) &buf); + ext2fs_free_mem((void **) &block_buf); fs->read_inode = 0; fs->get_blocks = 0; } |