#include <sys/stat.h>
#include <sys/vfs.h>
#include <sys/ioctl.h>
+#ifdef HAVE_LINUX_FD_H
#include <linux/fd.h>
+#endif
#include <ext2fs/ext2fs.h>
#include <ext2fs/ext2_types.h>
#include <ext2fs/fiemap.h>
__u64 buf[2048]; /* __u64 for proper field alignment */
struct fiemap *fiemap = (struct fiemap *)buf;
struct fiemap_extent *fm_ext = &fiemap->fm_extents[0];
- struct fiemap_extent fm_last = {0};
+ struct fiemap_extent fm_last;
int count = (sizeof(buf) - sizeof(*fiemap)) /
sizeof(struct fiemap_extent);
unsigned long long expected = 0;
int rc;
memset(fiemap, 0, sizeof(struct fiemap));
+ memset(&fm_last, 0, sizeof(fm_last));
if (sync_file)
flags |= FIEMAP_FLAG_SYNC;
char *end;
blocksize = strtoul(optarg, &end, 0);
if (end) {
+#if __GNUC_PREREQ (7, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#endif
switch (end[0]) {
case 'g':
case 'G':
blocksize *= 1024;
- /* no break */
+ /* fall through */
case 'm':
case 'M':
blocksize *= 1024;
- /* no break */
+ /* fall through */
case 'k':
case 'K':
blocksize *= 1024;
default:
break;
}
+#if __GNUC_PREREQ (7, 0)
+#pragma GCC diagnostic pop
+#endif
}
} else { /* Allow -b without argument for compat. Remove
* this eventually so "-b {blocksize}" works */