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

Function dnode_slots_tryenter

freebsd/contrib/openzfs/module/zfs/dnode.c:1064–1083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1062}
1063
1064static int
1065dnode_slots_tryenter(dnode_children_t *children, int idx, int slots)
1066{
1067 ASSERT3S(idx + slots, <=, DNODES_PER_BLOCK);
1068
1069 for (int i = idx; i < idx + slots; i++) {
1070 dnode_handle_t *dnh = &children->dnc_children[i];
1071
1072 if (!zrl_tryenter(&dnh->dnh_zrlock)) {
1073 for (int j = idx; j < i; j++) {
1074 dnh = &children->dnc_children[j];
1075 zrl_exit(&dnh->dnh_zrlock);
1076 }
1077
1078 return (0);
1079 }
1080 }
1081
1082 return (1);
1083}
1084
1085static void
1086dnode_set_slots(dnode_children_t *children, int idx, int slots, void *ptr)

Callers 2

dnode_hold_implFunction · 0.85

Calls 2

zrl_tryenterFunction · 0.85
zrl_exitFunction · 0.85

Tested by

no test coverage detected