summaryrefslogtreecommitdiff
path: root/src/extent-scan.h
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-10-11 11:19:02 +0200
committerJim Meyering <meyering@redhat.com>2011-01-30 20:44:11 +0100
commit50040d07e1fca7cae7aee3827053efb71454e6f2 (patch)
tree2cde0b27a584c3f23b3e7fcb1c9bc1b040755eb2 /src/extent-scan.h
parent0b9f65dc017fa66a47c19f63f49bd013fac0d29c (diff)
downloadcoreutils-50040d07e1fca7cae7aee3827053efb71454e6f2.tar.xz
extent-scan: adjust naming and formatting
* src/extent-scan.h [struct extent_scan]: Rename member: s/hit_last_extent/hit_final_extent/. "final" is clearer, since "last" can be interpreted as "preceding". Rename extent-scan functions to start with extent_scan_. * src/Makefile.am (copy_sources): Also distribute extent-scan.h. * src/extent-scan.c: Don't include error.h or quote.h. Neither is used. * src/copy.c: shorten a comment to fit in 80 columns * src/extent-scan.c, src/extent-scan.h: Correct formatting.
Diffstat (limited to 'src/extent-scan.h')
-rw-r--r--src/extent-scan.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/extent-scan.h b/src/extent-scan.h
index 07c2e5bc5..ac9e5006f 100644
--- a/src/extent-scan.h
+++ b/src/extent-scan.h
@@ -19,7 +19,7 @@
#ifndef EXTENT_SCAN_H
# define EXTENT_SCAN_H
-/* Structure used to reserve information of each extent. */
+/* Structure used to store information of each extent. */
struct extent_info
{
/* Logical offset of an extent. */
@@ -44,25 +44,25 @@ struct extent_scan
/* How many extent info returned for a scan. */
uint32_t ei_count;
- /* If true, fall back to a normal copy, either
- set by the failure of ioctl(2) for FIEMAP or
- lseek(2) with SEEK_DATA. */
+ /* If true, fall back to a normal copy, either set by the
+ failure of ioctl(2) for FIEMAP or lseek(2) with SEEK_DATA. */
bool initial_scan_failed;
- /* If ture, the total extent scan per file has been finished. */
- bool hit_last_extent;
+ /* If true, the total extent scan per file has been finished. */
+ bool hit_final_extent;
- /* Extent information. */
+ /* Extent information: a malloc'd array of ei_count structs. */
struct extent_info *ext_info;
};
-void
-open_extent_scan (int src_fd, struct extent_scan *scan);
+void extent_scan_init (int src_fd, struct extent_scan *scan);
-bool
-get_extents_info (struct extent_scan *scan);
+bool extent_scan_read (struct extent_scan *scan);
-#define free_extents_info(ext_scan) free ((ext_scan)->ext_info)
-#define close_extent_scan(ext_scan) /* empty */
+static inline void
+extent_scan_free (struct extent_scan *scan)
+{
+ free (scan->ext_info);
+}
#endif /* EXTENT_SCAN_H */