summaryrefslogtreecommitdiff
path: root/fs/aufs/debug.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-10 05:30:17 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-10 05:30:17 -0300
commitd635711daa98be86d4c7fd01499c34f566b54ccb (patch)
treeaa5cc3760a27c3d57146498cb82fa549547de06c /fs/aufs/debug.c
parentc91265cd0efb83778f015b4d4b1129bd2cfd075e (diff)
Linux-libre 4.6.2-gnu
Diffstat (limited to 'fs/aufs/debug.c')
-rw-r--r--fs/aufs/debug.c76
1 files changed, 40 insertions, 36 deletions
diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c
index 4529831a9..14e69cbc8 100644
--- a/fs/aufs/debug.c
+++ b/fs/aufs/debug.c
@@ -128,25 +128,24 @@ static int do_pri_inode(aufs_bindex_t bindex, struct inode *inode, int hn,
void au_dpri_inode(struct inode *inode)
{
struct au_iinfo *iinfo;
+ struct au_hinode *hi;
aufs_bindex_t bindex;
int err, hn;
err = do_pri_inode(-1, inode, -1, NULL);
- if (err || !au_test_aufs(inode->i_sb))
+ if (err || !au_test_aufs(inode->i_sb) || is_bad_inode(inode))
return;
iinfo = au_ii(inode);
- if (!iinfo)
- return;
- dpri("i-1: bstart %d, bend %d, gen %d\n",
- iinfo->ii_bstart, iinfo->ii_bend, au_iigen(inode, NULL));
- if (iinfo->ii_bstart < 0)
+ dpri("i-1: btop %d, bbot %d, gen %d\n",
+ iinfo->ii_btop, iinfo->ii_bbot, au_iigen(inode, NULL));
+ if (iinfo->ii_btop < 0)
return;
hn = 0;
- for (bindex = iinfo->ii_bstart; bindex <= iinfo->ii_bend; bindex++) {
- hn = !!au_hn(iinfo->ii_hinode + bindex);
- do_pri_inode(bindex, iinfo->ii_hinode[0 + bindex].hi_inode, hn,
- iinfo->ii_hinode[0 + bindex].hi_whdentry);
+ for (bindex = iinfo->ii_btop; bindex <= iinfo->ii_bbot; bindex++) {
+ hi = au_hinode(iinfo, bindex);
+ hn = !!au_hn(hi);
+ do_pri_inode(bindex, hi->hi_inode, hn, hi->hi_whdentry);
}
}
@@ -165,6 +164,8 @@ static int do_pri_dentry(aufs_bindex_t bindex, struct dentry *dentry)
struct dentry *wh = NULL;
int hn;
struct au_iinfo *iinfo;
+ struct au_hinode *hi;
+ struct inode *inode;
if (!dentry || IS_ERR(dentry)) {
dpri("d%d: err %ld\n", bindex, PTR_ERR(dentry));
@@ -178,16 +179,18 @@ static int do_pri_dentry(aufs_bindex_t bindex, struct dentry *dentry)
au_dcount(dentry), dentry->d_flags,
d_unhashed(dentry) ? "un" : "");
hn = -1;
+ inode = NULL;
if (bindex >= 0
&& d_is_positive(dentry)
- && au_test_aufs(dentry->d_sb)) {
- iinfo = au_ii(d_inode(dentry));
- if (iinfo) {
- hn = !!au_hn(iinfo->ii_hinode + bindex);
- wh = iinfo->ii_hinode[0 + bindex].hi_whdentry;
- }
+ && au_test_aufs(dentry->d_sb))
+ inode = d_inode(dentry);
+ if (inode && !is_bad_inode(inode)) {
+ iinfo = au_ii(inode);
+ hi = au_hinode(iinfo, bindex);
+ hn = !!au_hn(hi);
+ wh = hi->hi_whdentry;
}
- do_pri_inode(bindex, d_inode(dentry), hn, wh);
+ do_pri_inode(bindex, inode, hn, wh);
return 0;
}
@@ -205,14 +208,14 @@ void au_dpri_dentry(struct dentry *dentry)
dinfo = au_di(dentry);
if (!dinfo)
return;
- dpri("d-1: bstart %d, bend %d, bwh %d, bdiropq %d, gen %d, tmp %d\n",
- dinfo->di_bstart, dinfo->di_bend,
+ dpri("d-1: btop %d, bbot %d, bwh %d, bdiropq %d, gen %d, tmp %d\n",
+ dinfo->di_btop, dinfo->di_bbot,
dinfo->di_bwh, dinfo->di_bdiropq, au_digen(dentry),
dinfo->di_tmpfile);
- if (dinfo->di_bstart < 0)
+ if (dinfo->di_btop < 0)
return;
hdp = dinfo->di_hdentry;
- for (bindex = dinfo->di_bstart; bindex <= dinfo->di_bend; bindex++)
+ for (bindex = dinfo->di_btop; bindex <= dinfo->di_bbot; bindex++)
do_pri_dentry(bindex, hdp[0 + bindex].hd_dentry);
}
@@ -284,10 +287,10 @@ static int do_pri_br(aufs_bindex_t bindex, struct au_branch *br)
if (!sb || IS_ERR(sb))
goto out;
- dpri("s%d: {perm 0x%x, id %d, cnt %d, wbr %p}, "
+ dpri("s%d: {perm 0x%x, id %d, cnt %lld, wbr %p}, "
"%s, dev 0x%02x%02x, flags 0x%lx, cnt %d, active %d, "
"xino %d\n",
- bindex, br->br_perm, br->br_id, atomic_read(&br->br_count),
+ bindex, br->br_perm, br->br_id, au_br_count(br),
br->br_wbr, au_sbtype(sb), MAJOR(sb->s_dev), MINOR(sb->s_dev),
sb->s_flags, sb->s_count,
atomic_read(&sb->s_active), !!br->br_xino.xi_file);
@@ -318,9 +321,9 @@ void au_dpri_sb(struct super_block *sb)
a->mnt.mnt_sb = sb;
a->fake.br_path.mnt = &a->mnt;
- atomic_set(&a->fake.br_count, 0);
- smp_mb(); /* atomic_set */
+ au_br_count_init(&a->fake);
err = do_pri_br(-1, &a->fake);
+ au_br_count_fin(&a->fake);
kfree(a);
dpri("dev 0x%x\n", sb->s_dev);
if (err || !au_test_aufs(sb))
@@ -329,10 +332,11 @@ void au_dpri_sb(struct super_block *sb)
sbinfo = au_sbi(sb);
if (!sbinfo)
return;
- dpri("nw %d, gen %u, kobj %d\n",
- atomic_read(&sbinfo->si_nowait.nw_len), sbinfo->si_generation,
+ dpri("nw %lld, gen %u, kobj %d\n",
+ percpu_counter_sum(&sbinfo->si_nowait.nw_len),
+ sbinfo->si_generation,
atomic_read(&sbinfo->si_kobj.kref.refcount));
- for (bindex = 0; bindex <= sbinfo->si_bend; bindex++)
+ for (bindex = 0; bindex <= sbinfo->si_bbot; bindex++)
do_pri_br(bindex, sbinfo->si_branch[0 + bindex]);
}
@@ -342,21 +346,21 @@ void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line)
{
struct inode *h_inode, *inode = d_inode(dentry);
struct dentry *h_dentry;
- aufs_bindex_t bindex, bend, bi;
+ aufs_bindex_t bindex, bbot, bi;
if (!inode /* || au_di(dentry)->di_lsc == AuLsc_DI_TMP */)
return;
- bend = au_dbend(dentry);
- bi = au_ibend(inode);
- if (bi < bend)
- bend = bi;
- bindex = au_dbstart(dentry);
- bi = au_ibstart(inode);
+ bbot = au_dbbot(dentry);
+ bi = au_ibbot(inode);
+ if (bi < bbot)
+ bbot = bi;
+ bindex = au_dbtop(dentry);
+ bi = au_ibtop(inode);
if (bi > bindex)
bindex = bi;
- for (; bindex <= bend; bindex++) {
+ for (; bindex <= bbot; bindex++) {
h_dentry = au_h_dptr(dentry, bindex);
if (!h_dentry)
continue;