Lines Matching refs:len
29 offset_t off, offset_t len)
35 memset(out, 0, len);
39 if (off + len > buf_len) {
40 memset(out + (buf_len - off), 0, len - (buf_len - off));
41 len = buf_len - off;
45 assert(off + len <= buf_len);
47 memcpy(out, buf + off, len);
72 static int file_read(struct file *f, char *buf, offset_t off, offset_t len)
84 f->path, off, len);
88 if (off + len > UINT32_MAX) {
91 f->path, off, len);
92 len = UINT32_MAX - off;
97 f->path, off, len);
107 sought = lseek(fd, (off_t)len, SEEK_SET);
108 if (sought != (off_t)len) {
110 f->path, off, len, strerror(errno));
114 ret = read(fd, buf, (size_t)len);
115 if (ret != (ssize_t)len) {
117 f->path, off, len, strerror(errno));
126 static int dir_read(struct dir *d, char *buf, offset_t off, offset_t len)
131 return buffer_read((char*)d->entries, d->size, buf, off, len);
135 offset_t off, offset_t len)
144 off, len);
147 off, len);
150 off, len);
152 return file_read((struct file *)e, buf, off, len);
154 return dir_read((struct dir *)e, buf, off, len);
161 int fs_read(struct fs *fs, char *buf, offset_t start, offset_t len)
167 memset(buf, 0, len);
169 while ((e = fs_find_extent(fs, start, len, e,