Lines Matching refs:buf
90 void *buf;
97 static int dev_write_fd(void *buf, __u64 offset, size_t len)
101 ssize_t written = write(config.fd, buf, len);
114 free(bi->buf);
119 static int dev_write_sparse(void *buf, __u64 byte_offset, size_t byte_len)
126 bi->buf = malloc(byte_len);
127 if (bi->buf == NULL) {
133 memcpy(bi->buf, buf, byte_len);
137 sparse_file_add_data(f2fs_sparse_file, bi->buf, byte_len, byte_offset/F2FS_BLKSIZE);
153 int dev_read_version(void *buf, __u64 offset, size_t len)
158 int dev_read(void *buf, __u64 offset, size_t len)
163 int dev_write(void *buf, __u64 offset, size_t len)
166 return dev_write_fd(buf, offset, len);
168 return dev_write_sparse(buf, offset, len);
173 int dev_fill(void *buf, __u64 offset, size_t len)
177 return dev_write_fd(buf, offset, len);
180 // return sparse_file_add_fill(f2fs_sparse_file, ((__u8*)(bi->buf))[0], byte_len, byte_offset/F2FS_BLKSIZE);
184 int dev_read_block(void *buf, __u64 blk_addr)
190 int dev_read_blocks(void *buf, __u64 addr, __u32 nr_blks)