Lines Matching refs:dnode

286 	struct chfs_flash_data_node *dnode;  in chfs_write_flash_dnode()  local
295 dnode = chfs_alloc_flash_dnode(); in chfs_write_flash_dnode()
296 if (!dnode) in chfs_write_flash_dnode()
302 size = sizeof(*dnode) + len; in chfs_write_flash_dnode()
304 dnode->magic = htole16(CHFS_FS_MAGIC_BITMASK); in chfs_write_flash_dnode()
305 dnode->type = htole16(CHFS_NODETYPE_DATA); in chfs_write_flash_dnode()
306 dnode->length = htole32(CHFS_PAD(size)); in chfs_write_flash_dnode()
307 dnode->hdr_crc = htole32(crc32(0, (uint8_t *)dnode, in chfs_write_flash_dnode()
309 dnode->vno = htole64(ip->ino); in chfs_write_flash_dnode()
310 dnode->version = htole64(++ip->chvc->highest_version); in chfs_write_flash_dnode()
311 dnode->offset = htole64(ofs); in chfs_write_flash_dnode()
312 dnode->data_length = htole32(len); in chfs_write_flash_dnode()
313 dnode->data_crc = htole32(crc32(0, (uint8_t *)bp->b_data, len)); in chfs_write_flash_dnode()
314 dnode->node_crc = htole32(crc32(0, (uint8_t *)dnode, in chfs_write_flash_dnode()
315 sizeof(*dnode) - 4)); in chfs_write_flash_dnode()
317 dbg("dnode @%llu %ub v%llu\n", (unsigned long long)dnode->offset, in chfs_write_flash_dnode()
318 dnode->data_length, (unsigned long long)dnode->version); in chfs_write_flash_dnode()
321 if (CHFS_PAD(size) - sizeof(*dnode)) { in chfs_write_flash_dnode()
323 - sizeof(*dnode), KM_SLEEP); in chfs_write_flash_dnode()
329 vec[0].iov_base = dnode; in chfs_write_flash_dnode()
330 vec[0].iov_len = sizeof(*dnode); in chfs_write_flash_dnode()
332 vec[1].iov_len = CHFS_PAD(size) - sizeof(*dnode); in chfs_write_flash_dnode()
393 chfs_remove_and_obsolete(chmp, ip->chvc, fd->nref, &ip->chvc->dnode); in chfs_write_flash_dnode()
399 chfs_add_node_to_list(chmp, ip->chvc, nref, &ip->chvc->dnode); in chfs_write_flash_dnode()
402 chfs_free_flash_dnode(dnode); in chfs_write_flash_dnode()
403 if (CHFS_PAD(size) - sizeof(*dnode)) { in chfs_write_flash_dnode()
404 kmem_free(tmpbuf, CHFS_PAD(size) - sizeof(*dnode)); in chfs_write_flash_dnode()
520 while (ip->chvc->dnode != (struct chfs_node_ref *)ip->chvc) { in chfs_do_unlink()
521 nref = ip->chvc->dnode; in chfs_do_unlink()
523 chfs_remove_and_obsolete(chmp, ip->chvc, nref, &ip->chvc->dnode); in chfs_do_unlink()