Lines Matching refs:fd
70 static bool seek_read_hugepage_filemap(int fd, size_t len, size_t wr_chunk_size,
81 if (lseek(fd, offset, SEEK_SET) < 0) {
87 ret_count = read(fd, buf, wr_chunk_size);
107 static bool read_hugepage_filemap(int fd, size_t len,
118 ret_count = read(fd, buf, wr_chunk_size);
139 test_hugetlb_read(int fd, size_t len, size_t wr_chunk_size)
144 if (ftruncate(fd, len) < 0) {
150 MAP_SHARED | MAP_POPULATE, fd, 0);
159 if (read_hugepage_filemap(fd, len, wr_chunk_size, len))
164 if (ftruncate(fd, 0) < 0) {
173 test_hugetlb_read_hwpoison(int fd, size_t len, size_t wr_chunk_size,
181 if (ftruncate(fd, len) < 0) {
187 MAP_SHARED | MAP_POPULATE, fd, 0);
213 if (read_hugepage_filemap(fd, len, wr_chunk_size,
221 if (seek_read_hugepage_filemap(fd, len, wr_chunk_size,
230 if (ftruncate(fd, 0) < 0) {
240 int fd;
242 fd = memfd_create("hugetlb_tmp", MFD_HUGETLB);
243 if (fd < 0) {
249 if (fstatfs(fd, file_stat)) {
258 return fd;
260 close(fd);
266 int fd;
280 fd = create_hugetlbfs_file(&file_stat);
281 if (fd < 0)
284 status = test_hugetlb_read(fd, file_stat.f_bsize,
288 close(fd);
292 fd = create_hugetlbfs_file(&file_stat);
293 if (fd < 0)
296 status = test_hugetlb_read_hwpoison(fd, file_stat.f_bsize,
300 close(fd);
304 fd = create_hugetlbfs_file(&file_stat);
305 if (fd < 0)
308 status = test_hugetlb_read_hwpoison(fd, file_stat.f_bsize,
312 close(fd);