diff options
author | jeff.liu <jeff.liu@oracle.com> | 2010-09-29 16:11:41 +0800 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-01-30 20:44:11 +0100 |
commit | 2db1433eabc847d9ad43e059764222e9b33233aa (patch) | |
tree | 52004fa39c3225022cbb77d501be0f3ffd309add /tests/init.sh | |
parent | f3e78eeff292fcc79814e62d015a271688e0212a (diff) | |
download | coreutils-2db1433eabc847d9ad43e059764222e9b33233aa.tar.xz |
fiemap copy: add extent-scan.[ch], avoid a double-free and reorganize
Changes:
========
1. fix write_zeros() per Jim's comments.
2. remove char const *fname from struct extent_scan.
3. change the signature of open_extent_scan() from
"void open_extent_scan(struct extent_scan **scan)" to
"void open_extent_scan(struct extent_scan *scan)" to avoid having
to malloc the extent_scan variable; instead save it on the stack.
4. move close_extent_scan() from a function defined in extent-scan.c
to extent-scan.h as a macro definition, but it does nothing for now,
since initial extent scan defined at stack.
5. add a macro "free_extents_info()" defined at extent-scan.h to
release the memory allocated to extent info which should be called
combine with get_extents_info(), it just one line, so IMHO, define
it as macro should be ok.
* src/extent-scan.c: New file; functions to read "extents".
* src/extent-scan.h: Header file of extent-scan.c.
* src/Makefile.am: Reference it and link it to copy_source.
* src/copy.c: Use the new functions and avoid double-free.
Diffstat (limited to 'tests/init.sh')
0 files changed, 0 insertions, 0 deletions