+static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
+{
+ struct dk_minfo info;
+
+ *bytes = 0;
+
+ if (ioctl(f->fd, DKIOCGMEDIAINFO, &info) < 0)
+ return errno;
+
+ *bytes = info.dki_lbsize * info.dki_capacity;
+ return 0;
+}
+