/* * 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); }
int si_write_lock(struct super_block *sb, int flags) { int err; if (au_ftest_lock(flags, FLUSH)) au_nwt_flush(&au_sbi(sb)->si_nowait); si_noflush_write_lock(sb); err = au_plink_maint(sb, flags); if (unlikely(err)) si_write_unlock(sb); return err; }
/* * 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_plink_maint_enter(struct file *file) { int err; struct super_block *sb; struct au_sbinfo *sbinfo; err = 0; sb = file->f_dentry->d_sb; sbinfo = au_sbi(sb); /* make sure i am the only one in this fs */ si_write_lock(sb); /* spin_lock(&sbinfo->si_plink_maint_lock); */ if (!sbinfo->si_plink_maint) sbinfo->si_plink_maint = file; else err = -EBUSY; /* spin_unlock(&sbinfo->si_plink_maint_lock); */ si_write_unlock(sb); return err; }
void aufs_write_unlock(struct dentry *dentry) { di_write_unlock(dentry); si_write_unlock(dentry->d_sb); }
void aufs_write_unlock(struct dentry *dentry) { di_write_unlock(dentry); si_write_unlock(dentry->d_sb); //au_wkq_wait_nwtask(); }