* Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the GNU Library
+ * General Public License, version 2.
* %End-Header%
*/
+#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
(fs->blocksize / scan->inode_size - 1)) *
scan->inode_size / fs->blocksize;
}
- retval = ext2fs_get_array(scan->inode_buffer_blocks,
- fs->blocksize,
- &scan->inode_buffer);
+ retval = io_channel_alloc_buf(fs->io, scan->inode_buffer_blocks,
+ &scan->inode_buffer);
scan->done_group = 0;
scan->done_group_data = 0;
scan->bad_block_ptr = 0;
errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode * inode, int bufsize)
{
- unsigned long group, block, block_nr, offset;
+ blk64_t block_nr;
+ unsigned long group, block, offset;
char *ptr;
errcode_t retval;
int clen, i, inodes_per_block, length;
errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode * inode, int bufsize)
{
- unsigned long group, block, block_nr, offset;
+ blk64_t block_nr;
+ unsigned long group, block, offset;
errcode_t retval = 0;
struct ext2_inode_large temp_inode, *w_inode;
char *ptr;
if (length > (int) sizeof(struct ext2_inode_large)) {
w_inode = malloc(length);
- if (!w_inode)
- return ENOMEM;
+ if (!w_inode) {
+ retval = ENOMEM;
+ goto errout;
+ }
} else
w_inode = &temp_inode;
memset(w_inode, 0, length);