Lines Matching defs:commit

612 // commit operation
850 // traverse with commit
977 // traverse with commit
1147 // next commit not yet programmed?
1291 // did we end on a valid commit? we may have an erased block
1541 // commit logic
1553 static int lfs_dir_commitprog(lfs_t *lfs, struct lfs_commit *commit,
1557 commit->block, commit->off ,
1563 commit->crc = lfs_crc(commit->crc, buffer, size);
1564 commit->off += size;
1570 static int lfs_dir_commitattr(lfs_t *lfs, struct lfs_commit *commit,
1574 if (commit->off + dsize > commit->end) {
1579 lfs_tag_t ntag = lfs_tobe32((tag & 0x7fffffff) ^ commit->ptag);
1580 int err = lfs_dir_commitprog(lfs, commit, &ntag, sizeof(ntag));
1587 err = lfs_dir_commitprog(lfs, commit, buffer, dsize-sizeof(tag));
1604 err = lfs_dir_commitprog(lfs, commit, &dat, 1);
1611 commit->ptag = tag & 0x7fffffff;
1618 static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) {
1625 lfs_min(commit->off + 5*sizeof(uint32_t), lfs->cfg->block_size),
1631 // create crc tags to fill up remainder of commit, note that
1634 while (commit->off < end) {
1636 lfs_min(end - (commit->off+sizeof(lfs_tag_t)), 0x3fe)
1637 + (commit->off+sizeof(lfs_tag_t)));
1650 commit->block, noff, &eperturb, 1);
1671 commit->block, noff, fcrc.size, &fcrc.crc);
1677 err = lfs_dir_commitattr(lfs, commit,
1686 // build commit crc
1693 noff - (commit->off+sizeof(lfs_tag_t)));
1694 ccrc.tag = lfs_tobe32(ntag ^ commit->ptag);
1695 commit->crc = lfs_crc(commit->crc, &ccrc.tag, sizeof(lfs_tag_t));
1696 ccrc.crc = lfs_tole32(commit->crc);
1700 commit->block, commit->off, &ccrc, sizeof(ccrc));
1707 off1 = commit->off + sizeof(lfs_tag_t);
1708 crc1 = commit->crc;
1711 commit->off = noff;
1713 commit->ptag = ntag ^ ((0x80UL & ~eperturb) << 24);
1714 // reset crc for next commit
1715 commit->crc = 0xffffffff;
1728 // successful commit, check checksums to make sure
1732 lfs_off_t off = commit->begin;
1736 commit->block, off, off1-off, &crc);
1750 commit->block, off1, sizeof(uint32_t), &crc);
1876 struct lfs_commit *commit;
1882 struct lfs_dir_commit_commit *commit = p;
1883 return lfs_dir_commitattr(commit->lfs, commit->commit, tag, buffer);
1928 // begin loop to commit compaction to blocks until a compact sticks
1931 // setup commit state
1932 struct lfs_commit commit = {
1954 err = lfs_dir_commitprog(lfs, &commit,
1971 lfs, &commit});
1979 // commit tail, which may be new after last size check
1982 err = lfs_dir_commitattr(lfs, &commit,
2010 err = lfs_dir_commitattr(lfs, &commit,
2021 // complete commit with crc
2022 err = lfs_dir_commitcrc(lfs, &commit);
2031 LFS_ASSERT(commit.off % lfs->cfg->prog_size == 0);
2034 dir->off = commit.off;
2035 dir->etag = commit.ptag;
2045 // commit was corrupted, drop caches and prepare to relocate block
2217 // try to commit
2218 struct lfs_commit commit = {
2235 lfs, &commit});
2244 // commit any global diffs if we have any
2257 err = lfs_dir_commitattr(lfs, &commit,
2268 // finalize commit with the crc
2269 err = lfs_dir_commitcrc(lfs, &commit);
2277 // successful commit, update dir
2278 LFS_ASSERT(commit.off % lfs->cfg->prog_size == 0);
2279 dir->off = commit.off;
2280 dir->etag = commit.ptag;
2385 // commit was successful, but may require other changes in the
3402 // commit file data and attributes
3860 // commit (if predecessor is child)
3972 // commit (if predecessor is child)
3996 // let commit clean up after move (if we're different! otherwise move
4925 // did our commit create more orphans?
4959 // did our commit create more orphans?