diff options
author | Theodore Ts'o <tytso@mit.edu> | 1997-10-25 04:16:53 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1997-10-25 04:16:53 +0000 |
commit | c555aebde40afdc0d15d674f2c81c0e05cfded3f (patch) | |
tree | edd6191c9ba2a2f26a4484a94baa89ff5ddde9ce /lib/ext2fs/bmove.c | |
parent | f13048113f09def05a024470bfeaf44635bf7e98 (diff) | |
download | e2fsprogs-c555aebde40afdc0d15d674f2c81c0e05cfded3f.tar.gz |
Many files:
alloc.c (ext2fs_alloc_block): New function which allocates a
block and updates the filesystem accounting records
appropriately.
ext2_err.et.in: Added new error codes: EXT2_NO_MEMORY,
EXT2_INVALID_ARGUMENT, EXT2_BLOCK_ALLOC_FAIL, EXT2_INODE_ALLOC_FAIL,
EXT2_NOT_DIRECTORY
Change various library files to use these functions instead of EINVAL,
ENOENT, etc.
ChangeLog, pass1.c, pass3.c:
pass3.c (get_lost_and_found): Check error return of
EXT2_FILE_NOT_FOUND instead of ENOTDIR
pass1.c (pass1_check_directory): Return EXT2_NO_DIRECTORY instead of
ENOTDIR
expect.icount:
Change expected error string to be "Invalid argument passed to ext2 library"
instead of just "Invalid argument"
Diffstat (limited to 'lib/ext2fs/bmove.c')
-rw-r--r-- | lib/ext2fs/bmove.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/ext2fs/bmove.c b/lib/ext2fs/bmove.c index b1007935..61bc7900 100644 --- a/lib/ext2fs/bmove.c +++ b/lib/ext2fs/bmove.c @@ -18,9 +18,6 @@ #if HAVE_SYS_TIME_H #include <sys/time.h> #endif -#if HAVE_ERRNO_H -#include <errno.h> -#endif #include <linux/ext2_fs.h> #include "ext2fs/ext2fs.h" @@ -56,7 +53,7 @@ static int process_block(ext2_filsys fs, blk_t *block_nr, if (++block >= fs->super->s_blocks_count) block = fs->super->s_first_data_block; if (block == orig) { - pb->error = ENOSPC; + pb->error = EXT2_BLOCK_ALLOC_FAIL; return BLOCK_ABORT; } } while (ext2fs_test_block_bitmap(pb->reserve, block) || @@ -113,7 +110,7 @@ errcode_t ext2fs_move_blocks(ext2_filsys fs, block_buf = malloc(fs->blocksize * 4); if (!block_buf) - return ENOMEM; + return EXT2_NO_MEMORY; pb.buf = block_buf + fs->blocksize * 3; /* |