Whamcloud - gitweb
Convert to use io_channel_read_blk64() and io_channel_write_blk64()
authorValerie Aurora Henson <vaurora@redhat.com>
Tue, 8 Sep 2009 01:14:24 +0000 (21:14 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 8 Sep 2009 01:14:24 +0000 (21:14 -0400)
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
27 files changed:
debugfs/htree.c
debugfs/unused.c
e2fsck/ehandler.c
e2fsck/journal.c
e2fsck/pass1.c
e2fsck/pass1b.c
e2fsck/pass3.c
e2fsck/super.c
e2fsck/util.c
lib/ext2fs/bb_inode.c
lib/ext2fs/bmove.c
lib/ext2fs/closefs.c
lib/ext2fs/dirblock.c
lib/ext2fs/expanddir.c
lib/ext2fs/extent.c
lib/ext2fs/imager.c
lib/ext2fs/inode.c
lib/ext2fs/mkjournal.c
lib/ext2fs/openfs.c
lib/ext2fs/rw_bitmaps.c
lib/ext2fs/undo_io.c
misc/dumpe2fs.c
misc/e2image.c
misc/e2undo.c
misc/mke2fs.c
misc/tune2fs.c
resize/resize2fs.c

index 77dc88b..36fdb0e 100644 (file)
@@ -177,7 +177,7 @@ static void htree_dump_int_block(ext2_filsys fs, ext2_ino_t ino,
                goto errout;
        }
 
-       errcode = io_channel_read_blk(current_fs->io, pblk, 1, buf);
+       errcode = io_channel_read_blk64(current_fs->io, pblk, 1, buf);
        if (errcode) {
                com_err("htree_dump_int_block", errcode,
                        "while  reading block %u\n", blk);
@@ -261,8 +261,8 @@ void do_htree_dump(int argc, char *argv[])
                goto errout;
        }
 
-       errcode = io_channel_read_blk(current_fs->io, blk,
-                                     1, buf);
+       errcode = io_channel_read_blk64(current_fs->io, blk,
+                                       1, buf);
        if (errcode) {
                com_err(argv[0], errcode, "Error reading root node");
                goto errout;
@@ -401,7 +401,7 @@ static int search_dir_block(ext2_filsys fs, blk_t *blocknr,
 
        p = (struct process_block_struct *) priv_data;
 
-       errcode = io_channel_read_blk(current_fs->io, *blocknr, 1, p->buf);
+       errcode = io_channel_read_blk64(current_fs->io, *blocknr, 1, p->buf);
        if (errcode) {
                com_err("search_dir_block", errcode,
                        "while reading block %lu", (unsigned long) *blocknr);
index 15837fa..601b065 100644 (file)
@@ -39,7 +39,7 @@ void do_dump_unused(int argc EXT2FS_ATTR((unused)), char **argv)
             blk < current_fs->super->s_blocks_count; blk++) {
                if (ext2fs_test_block_bitmap2(current_fs->block_map,blk))
                        continue;
-               retval = io_channel_read_blk(current_fs->io, blk, 1, buf);
+               retval = io_channel_read_blk64(current_fs->io, blk, 1, buf);
                if (retval) {
                        com_err(argv[0], retval, "While reading block\n");
                        return;
index f9021f0..10216db 100644 (file)
@@ -43,7 +43,7 @@ static errcode_t e2fsck_handle_read_error(io_channel channel,
        if (count > 1) {
                p = (char *) data;
                for (i=0; i < count; i++, p += channel->block_size, block++) {
-                       error = io_channel_read_blk(channel, block,
+                       error = io_channel_read_blk64(channel, block,
                                                    1, p);
                        if (error)
                                return error;
@@ -59,7 +59,7 @@ static errcode_t e2fsck_handle_read_error(io_channel channel,
        preenhalt(ctx);
        if (ask(ctx, _("Ignore error"), 1)) {
                if (ask(ctx, _("Force rewrite"), 1))
-                       io_channel_write_blk(channel, block, 1, data);
+                       io_channel_write_blk64(channel, block, 1, data);
                return 0;
        }
 
@@ -91,7 +91,7 @@ static errcode_t e2fsck_handle_write_error(io_channel channel,
        if (count > 1) {
                p = (const char *) data;
                for (i=0; i < count; i++, p += channel->block_size, block++) {
-                       error = io_channel_write_blk(channel, block,
+                       error = io_channel_write_blk64(channel, block,
                                                     1, p);
                        if (error)
                                return error;
index 4eb9707..7e30ea5 100644 (file)
@@ -115,7 +115,7 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhp[])
                if (rw == READ && !bh->b_uptodate) {
                        jfs_debug(3, "reading block %lu/%p\n",
                                  (unsigned long) bh->b_blocknr, (void *) bh);
-                       retval = io_channel_read_blk(bh->b_io,
+                       retval = io_channel_read_blk64(bh->b_io,
                                                     bh->b_blocknr,
                                                     1, bh->b_data);
                        if (retval) {
@@ -129,7 +129,7 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhp[])
                } else if (rw == WRITE && bh->b_dirty) {
                        jfs_debug(3, "writing block %lu/%p\n",
                                  (unsigned long) bh->b_blocknr, (void *) bh);
-                       retval = io_channel_write_blk(bh->b_io,
+                       retval = io_channel_write_blk64(bh->b_io,
                                                      bh->b_blocknr,
                                                      1, bh->b_data);
                        if (retval) {
index 1064e9b..49b1863 100644 (file)
@@ -211,7 +211,7 @@ int e2fsck_pass1_check_symlink(ext2_filsys fs, ext2_ino_t ino,
                        if (inode->i_block[i])
                                return 0;
 
-               if (io_channel_read_blk(fs->io, inode->i_block[0], 1, buf))
+               if (io_channel_read_blk64(fs->io, inode->i_block[0], 1, buf))
                        return 0;
 
                len = strnlen(buf, fs->blocksize);
@@ -1564,7 +1564,7 @@ static int handle_htree(e2fsck_t ctx, struct problem_context *pctx,
                        return 0;
        }
 
-       retval = io_channel_read_blk(fs->io, blk, 1, block_buf);
+       retval = io_channel_read_blk64(fs->io, blk, 1, block_buf);
        if (retval && fix_problem(ctx, PR_1_HTREE_BADROOT, pctx))
                return 1;
 
@@ -2439,7 +2439,7 @@ static void new_table_block(e2fsck_t ctx, blk_t first_block, int group,
                pctx.blk = i;
                ext2fs_mark_block_bitmap2(ctx->block_found_map, (*new_block)+i);
                if (old_block) {
-                       pctx.errcode = io_channel_read_blk(fs->io,
+                       pctx.errcode = io_channel_read_blk64(fs->io,
                                   old_block + i, 1, buf);
                        if (pctx.errcode)
                                fix_problem(ctx, PR_1_RELOC_READ_ERR, &pctx);
@@ -2447,7 +2447,7 @@ static void new_table_block(e2fsck_t ctx, blk_t first_block, int group,
                        memset(buf, 0, fs->blocksize);
 
                pctx.blk = (*new_block) + i;
-               pctx.errcode = io_channel_write_blk(fs->io, pctx.blk,
+               pctx.errcode = io_channel_write_blk64(fs->io, pctx.blk,
                                              1, buf);
                if (pctx.errcode)
                        fix_problem(ctx, PR_1_RELOC_WRITE_ERR, &pctx);
index 71c4161..9aeab50 100644 (file)
@@ -691,13 +691,13 @@ static int clone_file_block(ext2_filsys fs,
                        printf("Cloning block %u to %u\n", *block_nr,
                               new_block);
 #endif
-                       retval = io_channel_read_blk(fs->io, *block_nr, 1,
+                       retval = io_channel_read_blk64(fs->io, *block_nr, 1,
                                                     cs->buf);
                        if (retval) {
                                cs->errcode = retval;
                                return BLOCK_ABORT;
                        }
-                       retval = io_channel_write_blk(fs->io, new_block, 1,
+                       retval = io_channel_write_blk64(fs->io, new_block, 1,
                                                      cs->buf);
                        if (retval) {
                                cs->errcode = retval;
index a7d19a1..efbecee 100644 (file)
@@ -729,7 +729,7 @@ static int expand_dir_proc(ext2_filsys fs,
                        return BLOCK_ABORT;
                }
                memset(block, 0, fs->blocksize);
-               retval = io_channel_write_blk(fs->io, new_blk, 1, block);
+               retval = io_channel_write_blk64(fs->io, new_blk, 1, block);
        }
        if (retval) {
                es->err = retval;
index 688f0fe..72d3268 100644 (file)
@@ -103,7 +103,7 @@ static int release_inode_block(ext2_filsys fs,
                        int     i, limit;
                        blk_t   *bp;
 
-                       pb->errcode = io_channel_read_blk(fs->io, blk, 1,
+                       pb->errcode = io_channel_read_blk64(fs->io, blk, 1,
                                                        pb->buf);
                        if (pb->errcode)
                                goto return_abort;
@@ -125,13 +125,13 @@ static int release_inode_block(ext2_filsys fs,
                 * it here.
                 */
                if ((blockcnt == pb->truncate_block) && pb->truncate_offset) {
-                       pb->errcode = io_channel_read_blk(fs->io, blk, 1,
+                       pb->errcode = io_channel_read_blk64(fs->io, blk, 1,
                                                        pb->buf);
                        if (pb->errcode)
                                goto return_abort;
                        memset(pb->buf + pb->truncate_offset, 0,
                               fs->blocksize - pb->truncate_offset);
-                       pb->errcode = io_channel_write_blk(fs->io, blk, 1,
+                       pb->errcode = io_channel_write_blk64(fs->io, blk, 1,
                                                         pb->buf);
                        if (pb->errcode)
                                goto return_abort;
index 56c6b35..fa156a1 100644 (file)
@@ -492,7 +492,7 @@ blk_t get_backup_sb(e2fsck_t ctx, ext2_filsys fs, const char *name,
                if (blocksize == 1024)
                        superblock++;
                io_channel_set_blksize(io, blocksize);
-               if (io_channel_read_blk(io, superblock,
+               if (io_channel_read_blk64(io, superblock,
                                        -SUPERBLOCK_SIZE, buf))
                        continue;
 #ifdef WORDS_BIGENDIAN
@@ -592,7 +592,7 @@ errcode_t e2fsck_zero_blocks(ext2_filsys fs, blk_t blk, int num,
                count = num - j;
                if (count > STRIDE_LENGTH)
                        count = STRIDE_LENGTH;
-               retval = io_channel_write_blk(fs->io, blk, count, buf);
+               retval = io_channel_write_blk64(fs->io, blk, count, buf);
                if (retval) {
                        if (ret_count)
                                *ret_count = count;
index 53122b5..bbebf6f 100644 (file)
@@ -244,7 +244,7 @@ static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
                                return BLOCK_ABORT;
                        }
                }
-               retval = io_channel_write_blk(fs->io, blk, 1, rec->block_buf);
+               retval = io_channel_write_blk64(fs->io, blk, 1, rec->block_buf);
                if (retval) {
                        rec->err = retval;
                        return BLOCK_ABORT;
index e56411c..49839c6 100644 (file)
@@ -59,12 +59,12 @@ static int process_block(ext2_filsys fs, blk_t      *block_nr,
                } while (ext2fs_test_block_bitmap2(pb->reserve, block) ||
                         ext2fs_test_block_bitmap2(pb->alloc_map, block));
 
-               retval = io_channel_read_blk(fs->io, orig, 1, pb->buf);
+               retval = io_channel_read_blk64(fs->io, orig, 1, pb->buf);
                if (retval) {
                        pb->error = retval;
                        return BLOCK_ABORT;
                }
-               retval = io_channel_write_blk(fs->io, block, 1, pb->buf);
+               retval = io_channel_write_blk64(fs->io, block, 1, pb->buf);
                if (retval) {
                        pb->error = retval;
                        return BLOCK_ABORT;
index e352092..2cf8a8b 100644 (file)
@@ -194,7 +194,7 @@ static errcode_t write_primary_superblock(ext2_filsys fs,
 
        if (!fs->io->manager->write_byte || !fs->orig_super) {
                io_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET);
-               retval = io_channel_write_blk(fs->io, 1, -SUPERBLOCK_SIZE,
+               retval = io_channel_write_blk64(fs->io, 1, -SUPERBLOCK_SIZE,
                                              super);
                io_channel_set_blksize(fs->io, fs->blocksize);
                return retval;
@@ -257,7 +257,7 @@ static errcode_t write_backup_super(ext2_filsys fs, dgrp_t group,
        fs->super->s_block_group_nr = sgrp;
 #endif
 
-       return io_channel_write_blk(fs->io, group_block, -SUPERBLOCK_SIZE,
+       return io_channel_write_blk64(fs->io, group_block, -SUPERBLOCK_SIZE,
                                    super_shadow);
 }
 
@@ -353,7 +353,7 @@ errcode_t ext2fs_flush(ext2_filsys fs)
                        continue;
                if ((old_desc_blk) &&
                    (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) || (i == 0))) {
-                       retval = io_channel_write_blk(fs->io,
+                       retval = io_channel_write_blk64(fs->io,
                              old_desc_blk, old_desc_blocks, group_ptr);
                        if (retval)
                                goto errout;
@@ -361,7 +361,7 @@ errcode_t ext2fs_flush(ext2_filsys fs)
                if (new_desc_blk) {
                        int meta_bg = i / EXT2_DESC_PER_BLOCK(fs->super);
 
-                       retval = io_channel_write_blk(fs->io, new_desc_blk,
+                       retval = io_channel_write_blk64(fs->io, new_desc_blk,
                                1, group_ptr + (meta_bg*fs->blocksize));
                        if (retval)
                                goto errout;
index c8dfce6..122319a 100644 (file)
@@ -108,7 +108,7 @@ errcode_t ext2fs_write_dir_block3(ext2_filsys fs, blk64_t block,
        ext2fs_free_mem(&buf);
        return retval;
 #else
-       return io_channel_write_blk(fs->io, block, 1, (char *) inbuf);
+       return io_channel_write_blk64(fs->io, block, 1, (char *) inbuf);
 #endif
 }
 
index 934eaf1..613f7bc 100644 (file)
@@ -61,7 +61,7 @@ static int expand_dir_proc(ext2_filsys        fs,
                        return BLOCK_ABORT;
                }
                memset(block, 0, fs->blocksize);
-               retval = io_channel_write_blk(fs->io, new_blk, 1, block);
+               retval = io_channel_write_blk64(fs->io, new_blk, 1, block);
        }
        if (retval) {
                es->err = retval;
index 1505447..0b3b60c 100644 (file)
@@ -443,7 +443,7 @@ retry:
                    (handle->fs->io != handle->fs->image_io))
                        memset(newpath->buf, 0, handle->fs->blocksize);
                else {
-                       retval = io_channel_read_blk(handle->fs->io,
+                       retval = io_channel_read_blk64(handle->fs->io,
                                                     blk, 1, newpath->buf);
                        if (retval)
                                return retval;
@@ -553,7 +553,7 @@ static errcode_t update_path(ext2_extent_handle_t handle)
                blk = ext2fs_le32_to_cpu(ix->ei_leaf) +
                        ((__u64) ext2fs_le16_to_cpu(ix->ei_leaf_hi) << 32);
 
-               retval = io_channel_write_blk(handle->fs->io,
+               retval = io_channel_write_blk64(handle->fs->io,
                                      blk, 1, handle->path[handle->level].buf);
        }
        return retval;
@@ -962,7 +962,8 @@ static errcode_t extent_node_split(ext2_extent_handle_t handle)
        new_node_start = ext2fs_le32_to_cpu(EXT_FIRST_INDEX(neweh)->ei_block);
 
        /* ...and write the new node block out to disk. */
-       retval = io_channel_write_blk(handle->fs->io, new_node_pblk, 1, block_buf);
+       retval = io_channel_write_blk64(handle->fs->io, new_node_pblk, 1,
+                                       block_buf);
 
        if (retval)
                goto done;
index c0c10f0..948b1ac 100644 (file)
@@ -81,7 +81,7 @@ errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags)
                        c = BUF_BLOCKS;
                        if (c > left)
                                c = left;
-                       retval = io_channel_read_blk(fs->io, blk, c, buf);
+                       retval = io_channel_read_blk64(fs->io, blk, c, buf);
                        if (retval)
                                goto errout;
                        cp = buf;
@@ -164,7 +164,7 @@ errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd,
                                retval = EXT2_ET_SHORT_READ;
                                goto errout;
                        }
-                       retval = io_channel_write_blk(fs->io, blk, c, buf);
+                       retval = io_channel_write_blk64(fs->io, blk, c, buf);
                        if (retval)
                                goto errout;
 
index f9cc43c..365d8c8 100644 (file)
@@ -365,7 +365,7 @@ static errcode_t get_next_blocks(ext2_inode_scan scan)
                memset(scan->inode_buffer, 0,
                       (size_t) num_blocks * scan->fs->blocksize);
        } else {
-               retval = io_channel_read_blk(scan->fs->io,
+               retval = io_channel_read_blk64(scan->fs->io,
                                             scan->current_block,
                                             (int) num_blocks,
                                             scan->inode_buffer);
@@ -588,7 +588,7 @@ errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
                        clen = fs->blocksize - offset;
 
                if (block_nr != fs->icache->buffer_blk) {
-                       retval = io_channel_read_blk(io, block_nr, 1,
+                       retval = io_channel_read_blk64(io, block_nr, 1,
                                                     fs->icache->buffer);
                        if (retval)
                                return retval;
@@ -708,7 +708,7 @@ errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
                        clen = fs->blocksize - offset;
 
                if (fs->icache->buffer_blk != block_nr) {
-                       retval = io_channel_read_blk(fs->io, block_nr, 1,
+                       retval = io_channel_read_blk64(fs->io, block_nr, 1,
                                                     fs->icache->buffer);
                        if (retval)
                                goto errout;
@@ -719,7 +719,7 @@ errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
                memcpy((char *) fs->icache->buffer + (unsigned) offset,
                       ptr, clen);
 
-               retval = io_channel_write_blk(fs->io, block_nr, 1,
+               retval = io_channel_write_blk64(fs->io, block_nr, 1,
                                              fs->icache->buffer);
                if (retval)
                        goto errout;
index 2f58466..7c5668d 100644 (file)
@@ -243,7 +243,7 @@ static int mkjournal_proc(ext2_filsys       fs,
        es->newblocks++;
        retval = 0;
        if (blockcnt <= 0)
-               retval = io_channel_write_blk(fs->io, new_blk, 1, es->buf);
+               retval = io_channel_write_blk64(fs->io, new_blk, 1, es->buf);
        else {
                if (es->zero_count) {
                        if ((es->blk_to_zero + es->zero_count == new_blk) &&
@@ -423,7 +423,8 @@ errcode_t ext2fs_add_journal_device(ext2_filsys fs, ext2_filsys journal_dev)
        start = 1;
        if (journal_dev->blocksize == 1024)
                start++;
-       if ((retval = io_channel_read_blk(journal_dev->io, start, -1024, buf)))
+       if ((retval = io_channel_read_blk64(journal_dev->io, start, -1024,
+                                           buf)))
                return retval;
 
        jsb = (journal_superblock_t *) buf;
@@ -448,7 +449,7 @@ errcode_t ext2fs_add_journal_device(ext2_filsys fs, ext2_filsys journal_dev)
        }
 
        /* Writeback the journal superblock */
-       if ((retval = io_channel_write_blk(journal_dev->io, start, -1024, buf)))
+       if ((retval = io_channel_write_blk64(journal_dev->io, start, -1024, buf)))
                return retval;
 
        fs->super->s_journal_inum = 0;
index 71cf7e8..3c0563a 100644 (file)
@@ -328,7 +328,7 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
        }
        for (i=first_meta_bg ; i < fs->desc_blocks; i++) {
                blk = ext2fs_descriptor_block_loc(fs, group_block, i);
-               retval = io_channel_read_blk(fs->io, blk, 1, dest);
+               retval = io_channel_read_blk64(fs->io, blk, 1, dest);
                if (retval)
                        goto cleanup;
 #ifdef WORDS_BIGENDIAN
index 05f8fed..0792c5b 100644 (file)
@@ -90,8 +90,8 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                }
                blk = fs->group_desc[i].bg_block_bitmap;
                if (blk) {
-                       retval = io_channel_write_blk(fs->io, blk, 1,
-                                                     block_buf);
+                       retval = io_channel_write_blk64(fs->io, blk, 1,
+                                                       block_buf);
                        if (retval)
                                return EXT2_ET_BLOCK_BITMAP_WRITE;
                }
@@ -113,7 +113,7 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
 
                blk = fs->group_desc[i].bg_inode_bitmap;
                if (blk) {
-                       retval = io_channel_write_blk(fs->io, blk, 1,
+                       retval = io_channel_write_blk64(fs->io, blk, 1,
                                                      inode_buf);
                        if (retval)
                                return EXT2_ET_INODE_BITMAP_WRITE;
@@ -195,7 +195,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                blk = (fs->image_header->offset_inodemap / fs->blocksize);
                ino_cnt = fs->super->s_inodes_count;
                while (inode_nbytes > 0) {
-                       retval = io_channel_read_blk(fs->image_io, blk++,
+                       retval = io_channel_read_blk64(fs->image_io, blk++,
                                                     1, inode_bitmap);
                        if (retval)
                                goto cleanup;
@@ -215,7 +215,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                blk_cnt = EXT2_BLOCKS_PER_GROUP(fs->super) *
                        fs->group_desc_count;
                while (block_nbytes > 0) {
-                       retval = io_channel_read_blk(fs->image_io, blk++,
+                       retval = io_channel_read_blk64(fs->image_io, blk++,
                                                     1, block_bitmap);
                        if (retval)
                                goto cleanup;
@@ -241,7 +241,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                            ext2fs_group_desc_csum_verify(fs, i))
                                blk = 0;
                        if (blk) {
-                               retval = io_channel_read_blk(fs->io, blk,
+                               retval = io_channel_read_blk64(fs->io, blk,
                                             -block_nbytes, block_bitmap);
                                if (retval) {
                                        retval = EXT2_ET_BLOCK_BITMAP_READ;
@@ -263,7 +263,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                            ext2fs_group_desc_csum_verify(fs, i))
                                blk = 0;
                        if (blk) {
-                               retval = io_channel_read_blk(fs->io, blk,
+                               retval = io_channel_read_blk64(fs->io, blk,
                                             -inode_nbytes, inode_bitmap);
                                if (retval) {
                                        retval = EXT2_ET_INODE_BITMAP_READ;
index 45bcad7..5efeeff 100644 (file)
@@ -148,7 +148,7 @@ static errcode_t write_file_system_identity(io_channel undo_channel,
        block_size = channel->block_size;
 
        io_channel_set_blksize(channel, SUPERBLOCK_OFFSET);
-       retval = io_channel_read_blk(channel, 1, -SUPERBLOCK_SIZE, &super);
+       retval = io_channel_read_blk64(channel, 1, -SUPERBLOCK_SIZE, &super);
        if (retval)
                goto err_out;
 
index 6e09f9d..37b75a1 100644 (file)
@@ -361,7 +361,7 @@ static void print_journal_information(ext2_filsys fs)
        journal_superblock_t    *jsb;
 
        /* Get the journal superblock */
-       if ((retval = io_channel_read_blk(fs->io, fs->super->s_first_data_block+1, -1024, buf))) {
+       if ((retval = io_channel_read_blk64(fs->io, fs->super->s_first_data_block+1, -1024, buf))) {
                com_err(program_name, retval,
                        _("while reading journal superblock"));
                exit(1);
index 7abce29..24b9a1e 100644 (file)
@@ -424,7 +424,7 @@ static void output_meta_data_blocks(ext2_filsys fs, int fd)
        for (blk = 0; blk < fs->super->s_blocks_count; blk++) {
                if ((blk >= fs->super->s_first_data_block) &&
                    ext2fs_test_block_bitmap2(meta_block_map, blk)) {
-                       retval = io_channel_read_blk(fs->io, blk, 1, buf);
+                       retval = io_channel_read_blk64(fs->io, blk, 1, buf);
                        if (retval) {
                                com_err(program_name, retval,
                                        "error reading block %u", blk);
index a5a360a..d47d6ce 100644 (file)
@@ -46,7 +46,7 @@ static int check_filesystem(TDB_CONTEXT *tdb, io_channel channel)
        struct ext2_super_block super;
 
        io_channel_set_blksize(channel, SUPERBLOCK_OFFSET);
-       retval = io_channel_read_blk(channel, 1, -SUPERBLOCK_SIZE, &super);
+       retval = io_channel_read_blk64(channel, 1, -SUPERBLOCK_SIZE, &super);
        if (retval) {
                com_err(prg_name,
                        retval, _("Failed to read the file system data \n"));
@@ -207,7 +207,7 @@ int main(int argc, char *argv[])
                blk_num = *(unsigned long *)key.dptr;
                printf(_("Replayed transaction of size %zd at location %ld\n"),
                                                        data.dsize, blk_num);
-               retval = io_channel_write_blk(channel, blk_num,
+               retval = io_channel_write_blk64(channel, blk_num,
                                                -data.dsize, data.dptr);
                if (retval == -1) {
                        com_err(prg_name, retval,
index 84c4361..0ce6017 100644 (file)
@@ -513,7 +513,7 @@ static void zap_sector(ext2_filsys fs, int sect, int nsect)
 
        if (sect == 0) {
                /* Check for a BSD disklabel, and don't erase it if so */
-               retval = io_channel_read_blk(fs->io, 0, -512, buf);
+               retval = io_channel_read_blk64(fs->io, 0, -512, buf);
                if (retval)
                        fprintf(stderr,
                                _("Warning: could not read block 0: %s\n"),
@@ -528,7 +528,7 @@ static void zap_sector(ext2_filsys fs, int sect, int nsect)
 
        memset(buf, 0, 512*nsect);
        io_channel_set_blksize(fs->io, 512);
-       retval = io_channel_write_blk(fs->io, sect, -512*nsect, buf);
+       retval = io_channel_write_blk64(fs->io, sect, -512*nsect, buf);
        io_channel_set_blksize(fs->io, fs->blocksize);
        free(buf);
        if (retval)
@@ -578,9 +578,9 @@ static void create_journal_dev(ext2_filsys fs)
        }
        ext2fs_zero_blocks(0, 0, 0, 0, 0);
 
-       retval = io_channel_write_blk(fs->io,
-                                     fs->super->s_first_data_block+1,
-                                     1, buf);
+       retval = io_channel_write_blk64(fs->io,
+                                       fs->super->s_first_data_block+1,
+                                       1, buf);
        if (retval) {
                com_err("create_journal_dev", retval,
                        _("while writing journal superblock"));
@@ -1772,7 +1772,7 @@ static int should_do_undo(const char *name)
        }
 
        io_channel_set_blksize(channel, SUPERBLOCK_OFFSET);
-       retval = io_channel_read_blk(channel, 1, -SUPERBLOCK_SIZE, &super);
+       retval = io_channel_read_blk64(channel, 1, -SUPERBLOCK_SIZE, &super);
        if (retval) {
                retval = 0;
                goto err_out;
index ef4861f..0911eb5 100644 (file)
@@ -197,7 +197,7 @@ static void remove_journal_device(ext2_filsys fs)
        }
 
        /* Get the journal superblock */
-       if ((retval = io_channel_read_blk(jfs->io, 1, -1024, buf))) {
+       if ((retval = io_channel_read_blk64(jfs->io, 1, -1024, buf))) {
                com_err(program_name, retval,
                        _("while reading journal superblock"));
                goto no_valid_journal;
@@ -229,7 +229,7 @@ static void remove_journal_device(ext2_filsys fs)
        jsb->s_nr_users = htonl(nr_users);
 
        /* Write back the journal superblock */
-       if ((retval = io_channel_write_blk(jfs->io, 1, -1024, buf))) {
+       if ((retval = io_channel_write_blk64(jfs->io, 1, -1024, buf))) {
                com_err(program_name, retval,
                        "while writing journal superblock.");
                goto no_valid_journal;
@@ -1097,11 +1097,11 @@ static int move_block(ext2_filsys fs, ext2fs_block_bitmap bmap)
 
                list_add(&(bmv->list), &blk_move_list);
 
-               retval = io_channel_read_blk(fs->io, blk, 1, buf);
+               retval = io_channel_read_blk64(fs->io, blk, 1, buf);
                if (retval)
                        goto err_out;
 
-               retval = io_channel_write_blk(fs->io, new_blk, 1, buf);
+               retval = io_channel_write_blk64(fs->io, new_blk, 1, buf);
                if (retval)
                        goto err_out;
        }
@@ -1283,7 +1283,7 @@ static int expand_inode_table(ext2_filsys fs, unsigned long new_ino_size)
 
        for (i = 0; i < fs->group_desc_count; i++) {
                blk = fs->group_desc[i].bg_inode_table;
-               retval = io_channel_read_blk(fs->io, blk,
+               retval = io_channel_read_blk64(fs->io, blk,
                                fs->inode_blocks_per_group, old_itable);
                if (retval)
                        goto err_out;
@@ -1302,7 +1302,7 @@ static int expand_inode_table(ext2_filsys fs, unsigned long new_ino_size)
                old_itable = tmp_old_itable;
                new_itable = tmp_new_itable;
 
-               retval = io_channel_write_blk(fs->io, blk,
+               retval = io_channel_write_blk64(fs->io, blk,
                                        new_ino_blks_per_grp, new_itable);
                if (retval)
                        goto err_out;
index 1a5d910..2e97177 100644 (file)
@@ -642,10 +642,10 @@ static errcode_t adjust_superblock(ext2_resize_t rfs, blk_t new_size)
                /*
                 * Write out the new inode table
                 */
-               retval = io_channel_write_blk(fs->io,
-                                             fs->group_desc[i].bg_inode_table,
-                                             fs->inode_blocks_per_group,
-                                             rfs->itable_buf);
+               retval = io_channel_write_blk64(fs->io,
+                                               fs->group_desc[i].bg_inode_table,
+                                               fs->inode_blocks_per_group,
+                                               rfs->itable_buf);
                if (retval) goto errout;
 
                io_channel_flush(fs->io);
@@ -1188,11 +1188,11 @@ static errcode_t block_mover(ext2_resize_t rfs)
                        c = size;
                        if (c > fs->inode_blocks_per_group)
                                c = fs->inode_blocks_per_group;
-                       retval = io_channel_read_blk(fs->io, old_blk, c,
-                                                    rfs->itable_buf);
+                       retval = io_channel_read_blk64(fs->io, old_blk, c,
+                                                      rfs->itable_buf);
                        if (retval) goto errout;
-                       retval = io_channel_write_blk(fs->io, new_blk, c,
-                                                     rfs->itable_buf);
+                       retval = io_channel_write_blk64(fs->io, new_blk, c,
+                                                       rfs->itable_buf);
                        if (retval) goto errout;
                        size -= c;
                        new_blk += c;
@@ -1634,9 +1634,9 @@ static errcode_t move_itables(ext2_resize_t rfs)
                if (!diff)
                        continue;
 
-               retval = io_channel_read_blk(fs->io, old_blk,
-                                            fs->inode_blocks_per_group,
-                                            rfs->itable_buf);
+               retval = io_channel_read_blk64(fs->io, old_blk,
+                                              fs->inode_blocks_per_group,
+                                              rfs->itable_buf);
                if (retval)
                        goto errout;
                /*
@@ -1658,15 +1658,15 @@ static errcode_t move_itables(ext2_resize_t rfs)
                if (n > diff)
                        num -= n;
 
-               retval = io_channel_write_blk(fs->io, new_blk,
-                                             num, rfs->itable_buf);
+               retval = io_channel_write_blk64(fs->io, new_blk,
+                                               num, rfs->itable_buf);
                if (retval) {
-                       io_channel_write_blk(fs->io, old_blk,
-                                            num, rfs->itable_buf);
+                       io_channel_write_blk64(fs->io, old_blk,
+                                              num, rfs->itable_buf);
                        goto errout;
                }
                if (n > diff) {
-                       retval = io_channel_write_blk(fs->io,
+                       retval = io_channel_write_blk64(fs->io,
                              old_blk + fs->inode_blocks_per_group,
                              diff, (rfs->itable_buf +
                                     (fs->inode_blocks_per_group - diff) *
@@ -1755,8 +1755,8 @@ static errcode_t fix_resize_inode(ext2_filsys fs)
 
        memset(block_buf, 0, fs->blocksize);
 
-       retval = io_channel_write_blk(fs->io, inode.i_block[EXT2_DIND_BLOCK],
-                                     1, block_buf);
+       retval = io_channel_write_blk64(fs->io, inode.i_block[EXT2_DIND_BLOCK],
+                                       1, block_buf);
        if (retval) goto errout;
 
        retval = ext2fs_create_resize_inode(fs);