sb_bytenr = BTRFS_SUPER_INFO_OFFSET;
/* try to drop all the caches */
- posix_fadvise(fp, 0, 0, POSIX_FADV_DONTNEED);
+ if (posix_fadvise(fp, 0, 0, POSIX_FADV_DONTNEED))
+ fprintf(stderr, "Warning, could not drop caches\n");
ret = btrfs_scan_one_device(fp, path, &fs_devices,
&total_devs, sb_bytenr);
device = list_entry(next, struct btrfs_device, dev_list);
if (device->fd) {
fsync(device->fd);
- posix_fadvise(device->fd, 0, 0, POSIX_FADV_DONTNEED);
+ if (posix_fadvise(device->fd, 0, 0, POSIX_FADV_DONTNEED))
+ fprintf(stderr, "Warning, could not drop caches\n");
}
close(device->fd);
}
goto fail;
}
- posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
+ if (posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED))
+ fprintf(stderr, "Warning, could not drop caches\n");
if (device->devid == fs_devices->latest_devid)
fs_devices->latest_bdev = fd;