.. | .. |
---|
13 | 13 | #include "xfs_mount.h" |
---|
14 | 14 | #include "xfs_inode.h" |
---|
15 | 15 | #include "xfs_bmap.h" |
---|
16 | | -#include "xfs_bmap_util.h" |
---|
17 | | -#include "xfs_bmap_btree.h" |
---|
18 | | -#include "xfs_alloc.h" |
---|
19 | | -#include "xfs_error.h" |
---|
20 | 16 | #include "xfs_trans.h" |
---|
21 | | -#include "xfs_trans_space.h" |
---|
22 | | -#include "xfs_trace.h" |
---|
23 | | -#include "xfs_buf.h" |
---|
24 | | -#include "xfs_icache.h" |
---|
25 | 17 | #include "xfs_rtalloc.h" |
---|
26 | | - |
---|
| 18 | +#include "xfs_error.h" |
---|
27 | 19 | |
---|
28 | 20 | /* |
---|
29 | 21 | * Realtime allocator bitmap functions shared with userspace. |
---|
.. | .. |
---|
74 | 66 | |
---|
75 | 67 | ip = issum ? mp->m_rsumip : mp->m_rbmip; |
---|
76 | 68 | |
---|
77 | | - error = xfs_bmapi_read(ip, block, 1, &map, &nmap, XFS_DATA_FORK); |
---|
| 69 | + error = xfs_bmapi_read(ip, block, 1, &map, &nmap, 0); |
---|
78 | 70 | if (error) |
---|
79 | 71 | return error; |
---|
80 | 72 | |
---|
81 | | - if (nmap == 0 || !xfs_bmap_is_real_extent(&map)) |
---|
| 73 | + if (XFS_IS_CORRUPT(mp, nmap == 0 || !xfs_bmap_is_written_extent(&map))) |
---|
82 | 74 | return -EFSCORRUPTED; |
---|
83 | 75 | |
---|
84 | 76 | ASSERT(map.br_startblock != NULLFSBLOCK); |
---|
.. | .. |
---|
505 | 497 | uint first = (uint)((char *)sp - (char *)bp->b_addr); |
---|
506 | 498 | |
---|
507 | 499 | *sp += delta; |
---|
| 500 | + if (mp->m_rsum_cache) { |
---|
| 501 | + if (*sp == 0 && log == mp->m_rsum_cache[bbno]) |
---|
| 502 | + mp->m_rsum_cache[bbno]++; |
---|
| 503 | + if (*sp != 0 && log < mp->m_rsum_cache[bbno]) |
---|
| 504 | + mp->m_rsum_cache[bbno] = log; |
---|
| 505 | + } |
---|
508 | 506 | xfs_trans_log_buf(tp, bp, first, first + sizeof(*sp) - 1); |
---|
509 | 507 | } |
---|
510 | 508 | if (sum) |
---|