MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dmu_objset_byteswap

Function dmu_objset_byteswap

freebsd/contrib/openzfs/module/zfs/dmu_objset.c:355–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355void
356dmu_objset_byteswap(void *buf, size_t size)
357{
358 objset_phys_t *osp = buf;
359
360 ASSERT(size == OBJSET_PHYS_SIZE_V1 || size == OBJSET_PHYS_SIZE_V2 ||
361 size == sizeof (objset_phys_t));
362 dnode_byteswap(&osp->os_meta_dnode);
363 byteswap_uint64_array(&osp->os_zil_header, sizeof (zil_header_t));
364 osp->os_type = BSWAP_64(osp->os_type);
365 osp->os_flags = BSWAP_64(osp->os_flags);
366 if (size >= OBJSET_PHYS_SIZE_V2) {
367 dnode_byteswap(&osp->os_userused_dnode);
368 dnode_byteswap(&osp->os_groupused_dnode);
369 if (size >= sizeof (objset_phys_t))
370 dnode_byteswap(&osp->os_projectused_dnode);
371 }
372}
373
374/*
375 * The hash is a CRC-based hash of the objset_t pointer and the object number.

Callers

nothing calls this directly

Calls 2

dnode_byteswapFunction · 0.85
byteswap_uint64_arrayFunction · 0.85

Tested by

no test coverage detected