Lines Matching refs:domain

385 static void erofs_fscache_domain_put(struct erofs_domain *domain)
388 if (refcount_dec_and_test(&domain->ref)) {
389 list_del(&domain->list);
394 fscache_relinquish_volume(domain->volume, NULL, false);
396 kfree(domain->domain_id);
397 kfree(domain);
431 struct erofs_domain *domain;
434 domain = kzalloc(sizeof(struct erofs_domain), GFP_KERNEL);
435 if (!domain)
438 domain->domain_id = kstrdup(sbi->domain_id, GFP_KERNEL);
439 if (!domain->domain_id) {
440 kfree(domain);
457 domain->volume = sbi->volume;
458 refcount_set(&domain->ref, 1);
459 list_add(&domain->list, &erofs_domain_list);
460 sbi->domain = domain;
463 kfree(domain->domain_id);
464 kfree(domain);
471 struct erofs_domain *domain;
475 list_for_each_entry(domain, &erofs_domain_list, list) {
476 if (!strcmp(domain->domain_id, sbi->domain_id)) {
477 sbi->domain = domain;
478 sbi->volume = domain->volume;
479 refcount_inc(&domain->ref);
557 struct erofs_domain *domain = EROFS_SB(sb)->domain;
569 refcount_inc(&domain->ref);
570 ctx->domain = domain;
579 struct erofs_domain *domain = EROFS_SB(sb)->domain;
584 if (ctx->domain != domain || strcmp(ctx->name, name))
589 erofs_err(sb, "%s already exists in domain %s", name,
590 domain->domain_id);
612 struct erofs_domain *domain = NULL;
616 if (!ctx->domain)
621 domain = ctx->domain;
626 if (domain)
627 erofs_fscache_domain_put(domain);
645 * When shared domain is enabled, using NEED_NOEXIST to guarantee
646 * the primary data blob (aka fsid) is unique in the shared domain.
648 * For non-shared-domain case, fscache_acquire_volume() invoked by
652 * Acquired domain/volume will be relinquished in kill_sb() on error.
670 if (sbi->domain)
671 erofs_fscache_domain_put(sbi->domain);
677 sbi->domain = NULL;