Also move the definition of 'written' ahead to make
old-compiler happy. In my local testbed, it keeps
complaining "crosses initialization of ‘int64_t written’"
accompanying with this change.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
r = _do_fiemap(from, srcoff, len, &exomap);
}
- int64_t written = 0;
+
+ int64_t written = 0;
+ if (r < 0)
+ goto out;
+
for (map<uint64_t, uint64_t>::iterator miter = exomap.begin(); miter != exomap.end(); ++miter) {
uint64_t it_off = miter->first - srcoff + dstoff;
r = _do_copy_range(from, to, miter->first, miter->second, it_off, true);