From: Andrew Morton ERROR: "__udivdi3" [fs/gfs2/gfs2.ko] undefined! This fixes the build error (faster, too) but the choice of types in there looks fishy to me - please re-review. Cc: Steven Whitehouse Signed-off-by: Andrew Morton --- fs/gfs2/ops_fstype.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff -puN fs/gfs2/ops_fstype.c~gfs2-avoid-64-bit-divide fs/gfs2/ops_fstype.c --- a/fs/gfs2/ops_fstype.c~gfs2-avoid-64-bit-divide +++ a/fs/gfs2/ops_fstype.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -342,11 +343,14 @@ static int map_journal_extents(struct gf struct gfs2_journal_extent *jext = NULL; struct buffer_head bh; int rc = 0; + u64 last_lb; INIT_LIST_HEAD(&jd->extent_list); prev_db = 0; - for (lb = 0; lb < ip->i_di.di_size / sdp->sd_sb.sb_bsize; lb++) { + last_lb = ip->i_di.di_size; + do_div(last_lb, sdp->sd_sb.sb_bsize); + for (lb = 0; lb < last_lb; lb++) { bh.b_state = 0; bh.b_blocknr = 0; bh.b_size = 1 << ip->i_inode.i_blkbits; _