/* * they are necessary regardless sysfs is disabled. */ void au_si_free(struct kobject *kobj) { struct au_sbinfo *sbinfo; struct super_block *sb; char *locked __maybe_unused; /* debug only */ sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); AuDebugOn(!list_empty(&sbinfo->si_plink.head)); AuDebugOn(sbinfo->si_plink_maint); sb = sbinfo->si_sb; si_write_lock(sb); au_xino_clr(sb); au_br_free(sbinfo); si_write_unlock(sb); AuDebugOn(radix_tree_gang_lookup (&sbinfo->au_si_pid.tree, (void **)&locked, /*first_index*/PID_MAX_DEFAULT - 1, /*max_items*/sizeof(locked)/sizeof(*locked))); kfree(sbinfo->si_branch); kfree(sbinfo->au_si_pid.bitmap); mutex_destroy(&sbinfo->si_xib_mtx); AuRwDestroy(&sbinfo->si_rwsem); kfree(sbinfo); }
/* * they are necessary regardless sysfs is disabled. */ void au_si_free(struct kobject *kobj) { struct au_sbinfo *sbinfo; struct super_block *sb; sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); AuDebugOn(!list_empty(&sbinfo->si_plink.head)); AuDebugOn(sbinfo->si_plink_maint); sb = sbinfo->si_sb; si_write_lock(sb); au_xino_clr(sb); au_br_free(sbinfo); kfree(sbinfo->si_branch); mutex_destroy(&sbinfo->si_xib_mtx); si_write_unlock(sb); AuRwDestroy(&sbinfo->si_rwsem); kfree(sbinfo); }
static int au_opt_xino(struct super_block *sb, struct au_opt *opt, struct au_opt_xino **opt_xino, struct au_opts *opts) { int err; aufs_bindex_t bend, bindex; struct dentry *root, *parent, *h_root; err = 0; switch (opt->type) { case Opt_xino: err = au_xino_set(sb, &opt->xino, !!au_ftest_opts(opts->flags, REMOUNT)); if (unlikely(err)) break; *opt_xino = &opt->xino; au_xino_brid_set(sb, -1); /* safe d_parent access */ parent = opt->xino.file->f_dentry->d_parent; root = sb->s_root; bend = au_sbend(sb); for (bindex = 0; bindex <= bend; bindex++) { h_root = au_h_dptr(root, bindex); if (h_root == parent) { au_xino_brid_set(sb, au_sbr_id(sb, bindex)); break; } } break; case Opt_noxino: au_xino_clr(sb); au_xino_brid_set(sb, -1); *opt_xino = (void *)-1; break; } return err; }