diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-07 15:44:28 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-07 15:44:28 -0700 |
commit | fa2925cf90e612cb9c10c45d0cb8a7c7332e56a7 (patch) | |
tree | b836666993fac5c9a157c2cb756c33fb66cb13e8 /fs/xfs/xfs_bmap.c | |
parent | 98e52c373cdc1239a9ec6a2763f519cc1d99dcbc (diff) | |
parent | cb7a93412ab52361bc255cbe2c767e0741c09f43 (diff) | |
download | linux-fa2925cf90e612cb9c10c45d0cb8a7c7332e56a7.tar.gz linux-fa2925cf90e612cb9c10c45d0cb8a7c7332e56a7.tar.bz2 linux-fa2925cf90e612cb9c10c45d0cb8a7c7332e56a7.zip |
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
xfs: Make fiemap work with sparse files
xfs: prevent 32bit overflow in space reservation
xfs: Disallow 32bit project quota id
xfs: improve buffer cache hash scalability
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( map[i].br_startblock)) goto out_free_map; - nexleft--; bmv->bmv_offset = out[cur_ext].bmv_offset + out[cur_ext].bmv_length; bmv->bmv_length = max_t(__int64_t, 0, bmvend - bmv->bmv_offset); + + /* + * In case we don't want to return the hole, + * don't increase cur_ext so that we can reuse + * it in the next loop. + */ + if ((iflags & BMV_IF_NO_HOLES) && + map[i].br_startblock == HOLESTARTBLOCK) { + memset(&out[cur_ext], 0, sizeof(out[cur_ext])); + continue; + } + + nexleft--; bmv->bmv_entries++; cur_ext++; } |