aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-10-07 09:43:11 +0200
committerIngo Molnar <mingo@elte.hu>2010-10-07 09:43:11 +0200
commitd4f8f217b8a5d5bd02af979650418dca4caec472 (patch)
treeaf047bfa9729c975e24cb7624107574e884d3a57 /fs/xfs/xfs_bmap.c
parent2dfbf4dfbe47a484bae20456c12b40763b9b6af7 (diff)
parent773e3f93577ffb493fb7c39b1a6ecf39b5748e87 (diff)
downloadkernel_samsung_smdk4412-d4f8f217b8a5d5bd02af979650418dca4caec472.zip
kernel_samsung_smdk4412-d4f8f217b8a5d5bd02af979650418dca4caec472.tar.gz
kernel_samsung_smdk4412-d4f8f217b8a5d5bd02af979650418dca4caec472.tar.bz2
Merge branch 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu into core/rcu
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 23f14e5..f90dadd 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++;
}