/* Write N_BYTES zero bytes to file descriptor FD. Return true if successful.
Upon write failure, set errno and return false. */
static bool
-write_zeros (int fd, uint64_t n_bytes)
+write_zeros (int fd, off_t n_bytes)
{
static char *zeros;
static size_t nz = IO_BUFSIZE;
while (n_bytes)
{
- uint64_t n = MIN (nz, n_bytes);
+ size_t n = MIN (nz, n_bytes);
if ((full_write (fd, zeros, n)) != n)
return false;
n_bytes -= n;
{
struct extent_scan scan;
off_t last_ext_start = 0;
- uint64_t last_ext_len = 0;
+ off_t last_ext_len = 0;
/* Keep track of the output position.
We may need this at the end, for a final ftruncate. */
for (i = 0; i < scan.ei_count || empty_extent; i++)
{
off_t ext_start;
- uint64_t ext_len;
- uint64_t hole_size;
+ off_t ext_len;
+ off_t hole_size;
if (i < scan.ei_count)
{
off_t ext_logical;
/* Extent length. */
- uint64_t ext_length;
+ off_t ext_length;
/* Extent flags, use it for FIEMAP only, or set it to zero. */
- uint32_t ext_flags;
+ unsigned int ext_flags;
};
/* Structure used to reserve extent scan information per file. */
off_t scan_start;
/* Flags to use for scan. */
- uint32_t fm_flags;
+ unsigned int fm_flags;
/* How many extent info returned for a scan. */
- uint32_t ei_count;
+ size_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. */
}
/* MAGIC[N] has a bit i set iff i is a quadratic residue mod N. */
-#define MAGIC64 ((uint64_t) 0x0202021202030213ULL)
-#define MAGIC63 ((uint64_t) 0x0402483012450293ULL)
-#define MAGIC65 ((uint64_t) 0x218a019866014613ULL)
+#define MAGIC64 0x0202021202030213ULL
+#define MAGIC63 0x0402483012450293ULL
+#define MAGIC65 0x218a019866014613ULL
#define MAGIC11 0x23b
/* Return the square root if the input is a square, otherwise 0. */