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

Function dbuf_sync_lightweight

freebsd/contrib/openzfs/module/zfs/dbuf.c:4159–4192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4157}
4158
4159noinline static void
4160dbuf_sync_lightweight(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
4161{
4162 dnode_t *dn = dr->dr_dnode;
4163 zio_t *pio;
4164 if (dn->dn_phys->dn_nlevels == 1) {
4165 pio = dn->dn_zio;
4166 } else {
4167 pio = dr->dr_parent->dr_zio;
4168 }
4169
4170 zbookmark_phys_t zb = {
4171 .zb_objset = dmu_objset_id(dn->dn_objset),
4172 .zb_object = dn->dn_object,
4173 .zb_level = 0,
4174 .zb_blkid = dr->dt.dll.dr_blkid,
4175 };
4176
4177 /*
4178 * See comment in dbuf_write(). This is so that zio->io_bp_orig
4179 * will have the old BP in dbuf_lightweight_done().
4180 */
4181 dr->dr_bp_copy = *dbuf_lightweight_bp(dr);
4182
4183 dr->dr_zio = zio_write(pio, dmu_objset_spa(dn->dn_objset),
4184 dmu_tx_get_txg(tx), &dr->dr_bp_copy, dr->dt.dll.dr_abd,
4185 dn->dn_datablksz, abd_get_size(dr->dt.dll.dr_abd),
4186 &dr->dt.dll.dr_props, dbuf_lightweight_ready, NULL,
4187 dbuf_lightweight_physdone, dbuf_lightweight_done, dr,
4188 ZIO_PRIORITY_ASYNC_WRITE,
4189 ZIO_FLAG_MUSTSUCCEED | dr->dt.dll.dr_flags, &zb);
4190
4191 zio_nowait(dr->dr_zio);
4192}
4193
4194/*
4195 * dbuf_sync_leaf() is called recursively from dbuf_sync_list() so it is

Callers 1

dbuf_sync_listFunction · 0.85

Calls 7

dmu_objset_idFunction · 0.85
dbuf_lightweight_bpFunction · 0.85
zio_writeFunction · 0.85
dmu_objset_spaFunction · 0.85
dmu_tx_get_txgFunction · 0.85
abd_get_sizeFunction · 0.85
zio_nowaitFunction · 0.85

Tested by

no test coverage detected