summaryrefslogtreecommitdiff
path: root/src/extent-scan.h
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-04-05 11:04:13 +0100
committerPádraig Brady <P@draigBrady.com>2011-04-06 23:15:19 +0100
commit18f5a8537c49d87a7ba5c3fa0bcf9215bf9877a7 (patch)
tree7d49768fa78a69249ea8b149db2cfdeb813350bd /src/extent-scan.h
parent8b2bedadb565489085e24833da34175e2be7e4cc (diff)
downloadcoreutils-18f5a8537c49d87a7ba5c3fa0bcf9215bf9877a7.tar.xz
copy: handle mergeable extents across fiemap scans
* extent-scan.h (extent_scan_free): Init the pointer to NULL, and reset the count to 0, so that we can realloc the buffer. * src/extent-scan.c (extent_scan_init): Likewise. (extent_scan_read): Loop over multiple fiemap scans, so we handle mergeable extents that span across fiemap scan boundaries. Once we have enough unique extents, return so as to minimize memory use.
Diffstat (limited to 'src/extent-scan.h')
-rw-r--r--src/extent-scan.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/extent-scan.h b/src/extent-scan.h
index 872851507..5b4ded57d 100644
--- a/src/extent-scan.h
+++ b/src/extent-scan.h
@@ -66,6 +66,8 @@ static inline void
extent_scan_free (struct extent_scan *scan)
{
free (scan->ext_info);
+ scan->ext_info = NULL;
+ scan->ei_count = 0;
}
#endif /* EXTENT_SCAN_H */