Lines Matching refs:fiemap_buf
497 struct fiemap fiemap_buf; in file_frag_count() local
502 memset(&fiemap_buf, 0, sizeof(struct fiemap)); in file_frag_count()
503 fiemap_buf.fm_start = 0; in file_frag_count()
504 fiemap_buf.fm_length = FIEMAP_MAX_OFFSET; in file_frag_count()
505 fiemap_buf.fm_flags |= FIEMAP_FLAG_SYNC; in file_frag_count()
507 ret = ioctl(fd, FS_IOC_FIEMAP, &fiemap_buf); in file_frag_count()
511 return fiemap_buf.fm_mapped_extents; in file_frag_count()
794 struct fiemap *fiemap_buf = NULL; in get_file_extents() local
808 fiemap_buf = malloc(fie_buf_size); in get_file_extents()
809 if (fiemap_buf == NULL) in get_file_extents()
812 ext_buf = fiemap_buf->fm_extents; in get_file_extents()
813 memset(fiemap_buf, 0, fie_buf_size); in get_file_extents()
814 fiemap_buf->fm_length = FIEMAP_MAX_OFFSET; in get_file_extents()
815 fiemap_buf->fm_flags |= FIEMAP_FLAG_SYNC; in get_file_extents()
816 fiemap_buf->fm_extent_count = EXTENT_MAX_COUNT; in get_file_extents()
819 fiemap_buf->fm_start = pos; in get_file_extents()
821 ret = ioctl(fd, FS_IOC_FIEMAP, fiemap_buf); in get_file_extents()
822 if (ret < 0 || fiemap_buf->fm_mapped_extents == 0) in get_file_extents()
824 for (i = 0; i < fiemap_buf->fm_mapped_extents; i++) { in get_file_extents()
851 } while (fiemap_buf->fm_mapped_extents in get_file_extents()
856 FREE(fiemap_buf); in get_file_extents()
859 FREE(fiemap_buf); in get_file_extents()