diff options
Diffstat (limited to 'fs/aufs/sbinfo.c')
-rw-r--r-- | fs/aufs/sbinfo.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c index a9d782e43..aa970593a 100644 --- a/fs/aufs/sbinfo.c +++ b/fs/aufs/sbinfo.c @@ -20,7 +20,12 @@ void au_si_free(struct kobject *kobj) sbinfo = container_of(kobj, struct au_sbinfo, si_kobj); for (i = 0; i < AuPlink_NHASH; i++) AuDebugOn(!hlist_empty(&sbinfo->si_plink[i].head)); - AuDebugOn(atomic_read(&sbinfo->si_nowait.nw_len)); + au_nwt_fin(&sbinfo->si_nowait); + + AuDebugOn(percpu_counter_sum(&sbinfo->si_ninodes)); + percpu_counter_destroy(&sbinfo->si_ninodes); + AuDebugOn(percpu_counter_sum(&sbinfo->si_nfiles)); + percpu_counter_destroy(&sbinfo->si_nfiles); au_rw_write_lock(&sbinfo->si_rwsem); au_br_free(sbinfo); @@ -40,7 +45,6 @@ int au_si_alloc(struct super_block *sb) { int err, i; struct au_sbinfo *sbinfo; - static struct lock_class_key aufs_si; err = -ENOMEM; sbinfo = kzalloc(sizeof(*sbinfo), GFP_NOFS); @@ -58,13 +62,12 @@ int au_si_alloc(struct super_block *sb) au_nwt_init(&sbinfo->si_nowait); au_rw_init_wlock(&sbinfo->si_rwsem); - au_rw_class(&sbinfo->si_rwsem, &aufs_si); mutex_init(&sbinfo->au_si_pid.pid_mtx); - atomic_long_set(&sbinfo->si_ninodes, 0); - atomic_long_set(&sbinfo->si_nfiles, 0); + percpu_counter_init(&sbinfo->si_ninodes, 0, GFP_NOFS); + percpu_counter_init(&sbinfo->si_nfiles, 0, GFP_NOFS); - sbinfo->si_bend = -1; + sbinfo->si_bbot = -1; sbinfo->si_last_br_id = AUFS_BRANCH_MAX / 2; sbinfo->si_wbr_copyup = AuWbrCopyup_Def; @@ -122,7 +125,7 @@ int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr) AuRwMustWriteLock(&sbinfo->si_rwsem); err = -ENOMEM; - sz = sizeof(*brp) * (sbinfo->si_bend + 1); + sz = sizeof(*brp) * (sbinfo->si_bbot + 1); if (unlikely(!sz)) sz = sizeof(*brp); brp = au_kzrealloc(sbinfo->si_branch, sz, sizeof(*brp) * nbr, GFP_NOFS); |