diff options
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
| -rw-r--r-- | fs/xfs/xfs_bmap.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 23f14e595c18..f90dadd5a968 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
| @@ -5533,12 +5533,24 @@ xfs_getbmap( | |||
| 5533 | map[i].br_startblock)) | 5533 | map[i].br_startblock)) |
| 5534 | goto out_free_map; | 5534 | goto out_free_map; |
| 5535 | 5535 | ||
| 5536 | nexleft--; | ||
| 5537 | bmv->bmv_offset = | 5536 | bmv->bmv_offset = |
| 5538 | out[cur_ext].bmv_offset + | 5537 | out[cur_ext].bmv_offset + |
| 5539 | out[cur_ext].bmv_length; | 5538 | out[cur_ext].bmv_length; |
| 5540 | bmv->bmv_length = | 5539 | bmv->bmv_length = |
| 5541 | max_t(__int64_t, 0, bmvend - bmv->bmv_offset); | 5540 | max_t(__int64_t, 0, bmvend - bmv->bmv_offset); |
| 5541 | |||
| 5542 | /* | ||
| 5543 | * In case we don't want to return the hole, | ||
| 5544 | * don't increase cur_ext so that we can reuse | ||
| 5545 | * it in the next loop. | ||
| 5546 | */ | ||
| 5547 | if ((iflags & BMV_IF_NO_HOLES) && | ||
| 5548 | map[i].br_startblock == HOLESTARTBLOCK) { | ||
| 5549 | memset(&out[cur_ext], 0, sizeof(out[cur_ext])); | ||
| 5550 | continue; | ||
| 5551 | } | ||
| 5552 | |||
| 5553 | nexleft--; | ||
| 5542 | bmv->bmv_entries++; | 5554 | bmv->bmv_entries++; |
| 5543 | cur_ext++; | 5555 | cur_ext++; |
| 5544 | } | 5556 | } |
