diff options
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r-- | fs/gfs2/log.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 14333d81cf7d..69a583ec43c7 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. | 3 | * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. |
4 | * | 4 | * |
5 | * This copyrighted material is made available to anyone wishing to use, | 5 | * This copyrighted material is made available to anyone wishing to use, |
6 | * modify, copy, or redistribute it subject to the terms and conditions | 6 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -339,18 +339,14 @@ void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks) | |||
339 | 339 | ||
340 | static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn) | 340 | static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn) |
341 | { | 341 | { |
342 | struct inode *inode = sdp->sd_jdesc->jd_inode; | 342 | struct gfs2_journal_extent *je; |
343 | int error; | 343 | |
344 | struct buffer_head bh_map = { .b_state = 0, .b_blocknr = 0 }; | 344 | list_for_each_entry(je, &sdp->sd_jdesc->extent_list, extent_list) { |
345 | 345 | if (lbn >= je->lblock && lbn < je->lblock + je->blocks) | |
346 | bh_map.b_size = 1 << inode->i_blkbits; | 346 | return je->dblock + lbn; |
347 | error = gfs2_block_map(inode, lbn, &bh_map, 0); | 347 | } |
348 | if (error || !bh_map.b_blocknr) | 348 | |
349 | printk(KERN_INFO "error=%d, dbn=%llu lbn=%u", error, | 349 | return -1; |
350 | (unsigned long long)bh_map.b_blocknr, lbn); | ||
351 | gfs2_assert_withdraw(sdp, !error && bh_map.b_blocknr); | ||
352 | |||
353 | return bh_map.b_blocknr; | ||
354 | } | 350 | } |
355 | 351 | ||
356 | /** | 352 | /** |