Lines Matching defs:fd

102 		int fd, int64_t offset, unsigned int blocks, unsigned int block,
117 ret = sparse_file_add_fd(s, fd, offset, len, block);
125 ret = read_all(fd, copybuf, chunk);
133 lseek64(fd, len, SEEK_CUR);
140 int fd, unsigned int blocks, unsigned int block, uint32_t *crc32)
153 ret = read_all(fd, &fill_val, sizeof(fill_val));
181 int fd __unused, unsigned int blocks,
202 static int process_crc32_chunk(int fd, unsigned int chunk_size, uint32_t *crc32)
211 ret = read_all(fd, &file_crc32, sizeof(file_crc32));
223 static int process_chunk(struct sparse_file *s, int fd, off64_t offset,
234 ret = process_raw_chunk(s, chunk_data_size, fd, offset,
242 ret = process_fill_chunk(s, chunk_data_size, fd,
250 ret = process_skip_chunk(s, chunk_data_size, fd,
260 ret = process_crc32_chunk(fd, chunk_data_size, crc_ptr);
275 static int sparse_file_read_sparse(struct sparse_file *s, int fd, bool crc)
298 ret = read_all(fd, &sparse_header, sizeof(sparse_header));
323 lseek64(fd, sparse_header.file_hdr_sz - SPARSE_HEADER_LEN, SEEK_CUR);
327 ret = read_all(fd, &chunk_header, sizeof(chunk_header));
336 lseek64(fd, sparse_header.chunk_hdr_sz - CHUNK_HEADER_LEN, SEEK_CUR);
339 offset = lseek64(fd, 0, SEEK_CUR);
341 ret = process_chunk(s, fd, offset, sparse_header.chunk_hdr_sz, &chunk_header,
357 static int sparse_file_read_normal(struct sparse_file *s, int fd)
374 ret = read_all(fd, buf, to_read);
397 sparse_file_add_fd(s, fd, offset, to_read, block);
409 int sparse_file_read(struct sparse_file *s, int fd, bool sparse, bool crc)
416 return sparse_file_read_sparse(s, fd, crc);
418 return sparse_file_read_normal(s, fd);
422 struct sparse_file *sparse_file_import(int fd, bool verbose, bool crc)
429 ret = read_all(fd, &sparse_header, sizeof(sparse_header));
460 ret = lseek64(fd, 0, SEEK_SET);
469 ret = sparse_file_read(s, fd, true, crc);
478 struct sparse_file *sparse_file_import_auto(int fd, bool crc, bool verbose)
484 s = sparse_file_import(fd, verbose, crc);
489 len = lseek64(fd, 0, SEEK_END);
494 lseek64(fd, 0, SEEK_SET);
501 ret = sparse_file_read_normal(s, fd);