return io_channel_flush(io) ? -EIO : 0;
}
-void ll_rw_block(int rw, int op_flags, int nr, struct buffer_head *bhp[])
+void ll_rw_block(int rw, int op_flags EXT2FS_ATTR((unused)), int nr,
+ struct buffer_head *bhp[])
{
errcode_t retval;
struct buffer_head *bh;
static int ex_compar(const void *arg1, const void *arg2)
{
- struct ext2fs_extent *ex1 = (struct ext2fs_extent *)arg1;
- struct ext2fs_extent *ex2 = (struct ext2fs_extent *)arg2;
+ const struct ext2fs_extent *ex1 = (const struct ext2fs_extent *)arg1;
+ const struct ext2fs_extent *ex2 = (const struct ext2fs_extent *)arg2;
if (ex1->e_lblk < ex2->e_lblk)
return -1;
static int ex_len_compar(const void *arg1, const void *arg2)
{
- struct ext2fs_extent *ex1 = (struct ext2fs_extent *)arg1;
- struct ext2fs_extent *ex2 = (struct ext2fs_extent *)arg2;
+ const struct ext2fs_extent *ex1 = (const struct ext2fs_extent *)arg1;
+ const struct ext2fs_extent *ex2 = (const struct ext2fs_extent *)arg2;
if (ex1->e_len < ex2->e_len)
return 1;
return 0;
}
-static void ex_sort_and_merge(e2fsck_t ctx, struct extent_list *list)
+static void ex_sort_and_merge(struct extent_list *list)
{
- blk64_t ex_end;
- int i, j;
+ unsigned int i, j;
if (list->count < 2)
return;
static int ext4_modify_extent_list(e2fsck_t ctx, struct extent_list *list,
struct ext2fs_extent *ex, int del)
{
- int ret;
- int i, offset;
- struct ext2fs_extent add_ex = *ex, add_ex2;
+ int ret, offset;
+ unsigned int i;
+ struct ext2fs_extent add_ex = *ex;
/* First let's create a hole from ex->e_lblk of length ex->e_len */
for (i = 0; i < list->count; i++) {
list->extents[list->count - 1] = add_ex;
}
- ex_sort_and_merge(ctx, list);
+ ex_sort_and_merge(list);
/* Mark all occupied blocks allocated */
for (i = 0; i < list->count; i++)
return ext4_modify_extent_list(ctx, list, ex, 1 /* delete */);
}
-static int ext4_fc_read_extents(e2fsck_t ctx, int ino)
+static int ext4_fc_read_extents(e2fsck_t ctx, ino_t ino)
{
struct extent_list *extent_list = &ctx->fc_replay_state.fc_extent_list;
* for the inode so that we can flush all of them at once and it also saves us
* from continuously growing and shrinking the extent tree.
*/
-static void ext4_fc_flush_extents(e2fsck_t ctx, int ino)
+static void ext4_fc_flush_extents(e2fsck_t ctx, ino_t ino)
{
struct extent_list *extent_list = &ctx->fc_replay_state.fc_extent_list;
/* Helper struct for dentry replay routines */
struct dentry_info_args {
- int parent_ino, dname_len, ino, inode_len;
+ ino_t parent_ino;
+ int dname_len;
+ ino_t ino;
char *dname;
};
val + sizeof(struct ext4_fc_dentry_info),
darg->dname_len);
darg->dname[darg->dname_len] = 0;
- jbd_debug(1, "%s: %s, ino %d, parent %d\n",
+ jbd_debug(1, "%s: %s, ino %lu, parent %lu\n",
tag == EXT4_FC_TAG_CREAT ? "create" :
(tag == EXT4_FC_TAG_LINK ? "link" :
(tag == EXT4_FC_TAG_UNLINK ? "unlink" : "error")),
static int ext4_fc_handle_unlink(e2fsck_t ctx, struct ext4_fc_tl *tl, __u8 *val)
{
- struct ext2_inode inode;
struct dentry_info_args darg;
- ext2_filsys fs = ctx->fs;
int ret;
ret = tl_to_darg(&darg, tl, val);
static int ext4_fc_handle_inode(e2fsck_t ctx, __u8 *val)
{
- struct e2fsck_fc_replay_state *state = &ctx->fc_replay_state;
int ino, inode_len = EXT2_GOOD_OLD_INODE_SIZE;
struct ext2_inode_large *inode = NULL, *fc_inode = NULL;
__le32 fc_ino;
{
struct ext2fs_extent extent;
struct ext4_fc_add_range add_range;
- int ret = 0, ino;
+ ino_t ino;
+ int ret = 0;
memcpy(&add_range, val, sizeof(add_range));
ino = le32_to_cpu(add_range.fc_ino);