Lines Matching refs:off

16         lfs1_off_t off, void *buffer, lfs1_size_t size) {  in lfs1_cache_read()  argument
21 if (pcache && block == pcache->block && off >= pcache->off && in lfs1_cache_read()
22 off < pcache->off + lfs1->cfg->prog_size) { in lfs1_cache_read()
25 lfs1->cfg->prog_size - (off-pcache->off)); in lfs1_cache_read()
26 memcpy(data, &pcache->buffer[off-pcache->off], diff); in lfs1_cache_read()
29 off += diff; in lfs1_cache_read()
34 if (block == rcache->block && off >= rcache->off && in lfs1_cache_read()
35 off < rcache->off + lfs1->cfg->read_size) { in lfs1_cache_read()
38 lfs1->cfg->read_size - (off-rcache->off)); in lfs1_cache_read()
39 memcpy(data, &rcache->buffer[off-rcache->off], diff); in lfs1_cache_read()
42 off += diff; in lfs1_cache_read()
47 if (off % lfs1->cfg->read_size == 0 && size >= lfs1->cfg->read_size) { in lfs1_cache_read()
50 int err = lfs1->cfg->read(lfs1->cfg, block, off, data, diff); in lfs1_cache_read()
56 off += diff; in lfs1_cache_read()
63 rcache->off = off - (off % lfs1->cfg->read_size); in lfs1_cache_read()
65 rcache->off, rcache->buffer, lfs1->cfg->read_size); in lfs1_cache_read()
76 lfs1_off_t off, const void *buffer, lfs1_size_t size) { in lfs1_cache_cmp() argument
82 block, off+i, &c, 1); in lfs1_cache_cmp()
97 lfs1_off_t off, lfs1_size_t size, uint32_t *crc) { in lfs1_cache_crc() argument
101 block, off+i, &c, 1); in lfs1_cache_crc()
129 pcache->off, pcache->buffer, lfs1->cfg->prog_size); in lfs1_cache_flush()
136 pcache->off, pcache->buffer, lfs1->cfg->prog_size); in lfs1_cache_flush()
154 lfs1_off_t off, const void *buffer, lfs1_size_t size) { in lfs1_cache_prog() argument
159 if (block == pcache->block && off >= pcache->off && in lfs1_cache_prog()
160 off < pcache->off + lfs1->cfg->prog_size) { in lfs1_cache_prog()
163 lfs1->cfg->prog_size - (off-pcache->off)); in lfs1_cache_prog()
164 memcpy(&pcache->buffer[off-pcache->off], data, diff); in lfs1_cache_prog()
167 off += diff; in lfs1_cache_prog()
170 if (off % lfs1->cfg->prog_size == 0) { in lfs1_cache_prog()
185 if (off % lfs1->cfg->prog_size == 0 && in lfs1_cache_prog()
189 int err = lfs1->cfg->prog(lfs1->cfg, block, off, data, diff); in lfs1_cache_prog()
196 block, off, data, diff); in lfs1_cache_prog()
207 off += diff; in lfs1_cache_prog()
214 pcache->off = off - (off % lfs1->cfg->prog_size); in lfs1_cache_prog()
223 lfs1_off_t off, void *buffer, lfs1_size_t size) { in lfs1_bd_read() argument
227 block, off, buffer, size); in lfs1_bd_read()
231 lfs1_off_t off, const void *buffer, lfs1_size_t size) { in lfs1_bd_prog() argument
233 block, off, buffer, size); in lfs1_bd_prog()
237 lfs1_off_t off, const void *buffer, lfs1_size_t size) { in lfs1_bd_cmp() argument
238 return lfs1_cache_cmp(lfs1, &lfs1->rcache, NULL, block, off, buffer, size); in lfs1_bd_cmp()
242 lfs1_off_t off, lfs1_size_t size, uint32_t *crc) { in lfs1_bd_crc() argument
243 return lfs1_cache_crc(lfs1, &lfs1->rcache, NULL, block, off, size, crc); in lfs1_bd_crc()
277 lfs1_block_t off = ((block - lfs1->free.off) in lfs1_alloc_lookahead() local
280 if (off < lfs1->free.size) { in lfs1_alloc_lookahead()
281 lfs1->free.buffer[off / 32] |= 1U << (off % 32); in lfs1_alloc_lookahead()
290 lfs1_block_t off = lfs1->free.i; in lfs1_alloc() local
294 if (!(lfs1->free.buffer[off / 32] & (1U << (off % 32)))) { in lfs1_alloc()
296 *block = (lfs1->free.off + off) % lfs1->cfg->block_count; in lfs1_alloc()
314 lfs1->free.i + lfs1->free.off); in lfs1_alloc()
318 lfs1->free.off = (lfs1->free.off + lfs1->free.size) in lfs1_alloc()
433 dir->off = sizeof(dir->d); in lfs1_dir_alloc()
488 dir->off = sizeof(dir->d); in lfs1_dir_fetch()
662 {entry->off, sizeof(entry->d), &entry->d, sizeof(entry->d)}, in lfs1_dir_update()
663 {entry->off+sizeof(entry->d), entry->d.nlen, data, entry->d.nlen} in lfs1_dir_update()
674 entry->off = dir->d.size - 4; in lfs1_dir_append()
678 {entry->off, 0, &entry->d, sizeof(entry->d)}, in lfs1_dir_append()
679 {entry->off, 0, data, entry->d.nlen} in lfs1_dir_append()
695 entry->off = dir->d.size - 4; in lfs1_dir_append()
698 {entry->off, 0, &entry->d, sizeof(entry->d)}, in lfs1_dir_append()
699 {entry->off, 0, data, entry->d.nlen} in lfs1_dir_append()
739 {entry->off, lfs1_entry_size(entry), NULL, 0}, in lfs1_dir_remove()
748 if (f->poff == entry->off) { in lfs1_dir_remove()
751 } else if (f->poff > entry->off) { in lfs1_dir_remove()
759 if (d->off > entry->off) { in lfs1_dir_remove()
760 d->off -= lfs1_entry_size(entry); in lfs1_dir_remove()
770 while (dir->off + sizeof(entry->d) > (0x7fffffff & dir->d.size)-4) { in lfs1_dir_next()
772 entry->off = dir->off; in lfs1_dir_next()
781 dir->off = sizeof(dir->d); in lfs1_dir_next()
785 int err = lfs1_bd_read(lfs1, dir->pair[0], dir->off, in lfs1_dir_next()
792 entry->off = dir->off; in lfs1_dir_next()
793 dir->off += lfs1_entry_size(entry); in lfs1_dir_next()
878 entry->off + 4+entry->d.elen+entry->d.alen, in lfs1_dir_find()
981 dir->off = sizeof(dir->d); in lfs1_dir_open()
1053 entry.off + 4+entry.d.elen+entry.d.alen, in lfs1_dir_read()
1062 int lfs1_dir_seek(lfs1_t *lfs1, lfs1_dir_t *dir, lfs1_off_t off) { in lfs1_dir_seek() argument
1068 dir->pos = off; in lfs1_dir_seek()
1070 while (off > (0x7fffffff & dir->d.size)) { in lfs1_dir_seek()
1071 off -= 0x7fffffff & dir->d.size; in lfs1_dir_seek()
1082 dir->off = off; in lfs1_dir_seek()
1101 dir->off = sizeof(dir->d); in lfs1_dir_rewind()
1107 static int lfs1_ctz_index(lfs1_t *lfs1, lfs1_off_t *off) { in lfs1_ctz_index() argument
1108 lfs1_off_t size = *off; in lfs1_ctz_index()
1116 *off = size - b*i - 4*lfs1_popc(i); in lfs1_ctz_index()
1123 lfs1_size_t pos, lfs1_block_t *block, lfs1_off_t *off) { in lfs1_ctz_find() argument
1126 *off = 0; in lfs1_ctz_find()
1149 *off = pos; in lfs1_ctz_find()
1156 lfs1_block_t *block, lfs1_off_t *off) { in lfs1_ctz_extend() argument
1177 *off = 0; in lfs1_ctz_extend()
1206 *off = size; in lfs1_ctz_extend()
1239 *off = 4*skips; in lfs1_ctz_extend()
1339 file->poff = entry.off; in lfs1_file_opencfg()
1432 for (lfs1_off_t i = 0; i < file->off; i++) { in lfs1_file_relocate()
1453 file->cache.off = lfs1->pcache.off; in lfs1_file_relocate()
1547 lfs1_entry_t entry = {.off = file->poff}; in lfs1_file_sync()
1548 err = lfs1_bd_read(lfs1, cwd.pair[0], entry.off, in lfs1_file_sync()
1598 file->off == lfs1->cfg->block_size) { in lfs1_file_read()
1601 file->pos, &file->block, &file->off); in lfs1_file_read()
1610 lfs1_size_t diff = lfs1_min(nsize, lfs1->cfg->block_size - file->off); in lfs1_file_read()
1612 file->block, file->off, data, diff); in lfs1_file_read()
1618 file->off += diff; in lfs1_file_read()
1668 file->off == lfs1->cfg->block_size) { in lfs1_file_write()
1673 file->pos-1, &file->block, &file->off); in lfs1_file_write()
1687 &file->block, &file->off); in lfs1_file_write()
1697 lfs1_size_t diff = lfs1_min(nsize, lfs1->cfg->block_size - file->off); in lfs1_file_write()
1700 file->block, file->off, data, diff); in lfs1_file_write()
1719 file->off += diff; in lfs1_file_write()
1731 lfs1_soff_t off, int whence) { in lfs1_file_seek() argument
1741 npos = off; in lfs1_file_seek()
1743 npos = file->pos + off; in lfs1_file_seek()
1745 npos = file->size + off; in lfs1_file_seek()
1853 entry.off + 4+entry.d.elen+entry.d.alen, in lfs1_stat()
2110 lfs1->free.off = 0; in lfs1_format()
2139 .off = sizeof(superdir.d), in lfs1_format()
2196 lfs1->free.off = 0; in lfs1_mount()
2276 while (dir.off + sizeof(entry.d) <= (0x7fffffff & dir.d.size)-4) { in lfs1_traverse()
2277 err = lfs1_bd_read(lfs1, dir.pair[0], dir.off, in lfs1_traverse()
2284 dir.off += lfs1_entry_size(&entry); in lfs1_traverse()