Lines Matching refs:fd

99 		int fd, int64_t offset, unsigned int blocks, unsigned int block,
114 ret = sparse_file_add_fd(s, fd, offset, len, block);
122 ret = read_all(fd, copybuf, chunk);
130 lseek64(fd, len, SEEK_CUR);
137 int fd, unsigned int blocks, unsigned int block, uint32_t *crc32)
150 ret = read_all(fd, &fill_val, sizeof(fill_val));
178 int fd, unsigned int blocks, unsigned int block, uint32_t *crc32)
204 static int process_crc32_chunk(int fd, unsigned int chunk_size, uint32_t crc32)
213 ret = read_all(fd, &file_crc32, sizeof(file_crc32));
225 static int process_chunk(struct sparse_file *s, int fd, off64_t offset,
236 ret = process_raw_chunk(s, chunk_data_size, fd, offset,
244 ret = process_fill_chunk(s, chunk_data_size, fd,
252 ret = process_skip_chunk(s, chunk_data_size, fd,
262 ret = process_crc32_chunk(fd, chunk_data_size, *crc_ptr);
277 static int sparse_file_read_sparse(struct sparse_file *s, int fd, bool crc)
300 ret = read_all(fd, &sparse_header, sizeof(sparse_header));
325 lseek64(fd, sparse_header.file_hdr_sz - SPARSE_HEADER_LEN, SEEK_CUR);
329 ret = read_all(fd, &chunk_header, sizeof(chunk_header));
338 lseek64(fd, sparse_header.chunk_hdr_sz - CHUNK_HEADER_LEN, SEEK_CUR);
341 offset = lseek64(fd, 0, SEEK_CUR);
343 ret = process_chunk(s, fd, offset, sparse_header.chunk_hdr_sz, &chunk_header,
359 static int sparse_file_read_normal(struct sparse_file *s, int fd)
377 ret = read_all(fd, buf, to_read);
399 sparse_file_add_fd(s, fd, offset, to_read, block);
410 int sparse_file_read(struct sparse_file *s, int fd, bool sparse, bool crc)
417 return sparse_file_read_sparse(s, fd, crc);
419 return sparse_file_read_normal(s, fd);
423 struct sparse_file *sparse_file_import(int fd, bool verbose, bool crc)
430 ret = read_all(fd, &sparse_header, sizeof(sparse_header));
461 ret = lseek64(fd, 0, SEEK_SET);
470 ret = sparse_file_read(s, fd, true, crc);
479 struct sparse_file *sparse_file_import_auto(int fd, bool crc)
485 s = sparse_file_import(fd, true, crc);
490 len = lseek64(fd, 0, SEEK_END);
495 lseek64(fd, 0, SEEK_SET);
502 ret = sparse_file_read_normal(s, fd);