+again:
+ /*
+ * Serialize creation using HFS_CREATING_BTREE flag.
+ */
+ lck_mtx_lock(&hfsmp->hfs_mutex);
+ if (hfsmp->hfs_flags & HFS_CREATING_BTREE) {
+ /* Someone else beat us, wait for them to finish. */
+ (void) msleep(hfsmp->hfs_attribute_cp, &hfsmp->hfs_mutex,
+ PDROP | PINOD, "hfs_create_attr_btree", 0);
+ if (hfsmp->hfs_attribute_vp) {
+ return (0);
+ }
+ goto again;
+ }
+ hfsmp->hfs_flags |= HFS_CREATING_BTREE;
+ lck_mtx_unlock(&hfsmp->hfs_mutex);