+static inline unsigned long long get_fs_free_size(const char *path)
+{
+ unsigned long long ret;
+ struct statvfs s;
+
+ if (statvfs(path, &s) < 0)
+ return -1ULL;
+
+ ret = s.f_frsize;
+ ret *= (unsigned long long) s.f_bfree;
+ return ret;
+}
+
+static inline int os_trim(struct fio_file *f, unsigned long long start,
+ unsigned long long len)
+{
+ off_t range[2];
+
+ range[0] = start;
+ range[1] = len;
+
+ if (!ioctl(f->fd, DIOCGDELETE, range))
+ return 0;
+
+ return errno;
+}
+