summaryrefslogtreecommitdiff
path: root/e2fsck/journal.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2019-11-09 01:47:24 -0500
committerTheodore Ts'o <tytso@mit.edu>2019-11-09 01:55:14 -0500
commit4305084d35c40037269787778601b4f91e370529 (patch)
tree655e59143a2218972544ea064c51e24141330400 /e2fsck/journal.c
parentabbe0f9d70d2f6286e83b2168cd4f434c757a8a1 (diff)
downloade2fsprogs-4305084d35c40037269787778601b4f91e370529.tar.gz
Align the types used by jbd2_journal_bmap and getblk with the kernel
This avoids some 32-bit vs 64-bit discrepancies in the function signatures and the types used by their callers. This cleans up some sparse warnings in recovery.c. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/journal.c')
-rw-r--r--e2fsck/journal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 9a0ced5c..7d9f1b40 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -94,7 +94,7 @@ static errcode_t e2fsck_journal_sb_csum_set(journal_t *j,
* to use the recovery.c file virtually unchanged from the kernel, so we
* don't have to do much to keep kernel and user recovery in sync.
*/
-int jbd2_journal_bmap(journal_t *journal, blk64_t block,
+int jbd2_journal_bmap(journal_t *journal, unsigned long block,
unsigned long long *phys)
{
#ifdef USE_INODE_IO
@@ -111,13 +111,15 @@ int jbd2_journal_bmap(journal_t *journal, blk64_t block,
}
retval= ext2fs_bmap2(inode->i_ctx->fs, inode->i_ino,
- &inode->i_ext2, NULL, 0, block, 0, &pblk);
+ &inode->i_ext2, NULL, 0, (blk64_t) block,
+ 0, &pblk);
*phys = pblk;
return -1 * ((int) retval);
#endif
}
-struct buffer_head *getblk(kdev_t kdev, blk64_t blocknr, int blocksize)
+struct buffer_head *getblk(kdev_t kdev, unsigned long long blocknr,
+ int blocksize)
{
struct buffer_head *bh;
int bufsize = sizeof(*bh) + kdev->k_ctx->fs->blocksize -
@@ -132,7 +134,7 @@ struct buffer_head *getblk(kdev_t kdev, blk64_t blocknr, int blocksize)
bh_count++;
#endif
jfs_debug(4, "getblk for block %llu (%d bytes)(total %d)\n",
- (unsigned long long) blocknr, blocksize, bh_count);
+ blocknr, blocksize, bh_count);
bh->b_ctx = kdev->k_ctx;
if (kdev->k_dev == K_DEV_FS)