aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glops.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2018-04-18 15:05:01 -0400
committerAndreas Gruenbacher <agruenba@redhat.com>2018-12-12 06:33:23 -0500
commit27a2660f1ef944724956d92e8a312b6da0936fae (patch)
tree6882e4665a18c8ca750ac64c36e6eddc2393d251 /fs/gfs2/glops.c
parent2d29f6b96d8f80322ed2dd895bca590491c38d34 (diff)
gfs2: Dump nrpages for inodes and their glocks
This patch is based on an idea from Steve Whitehouse. The idea is to dump the number of pages for inodes in the glock dumps. The additional locking required me to drop const from quite a few places. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/glops.c')
-rw-r--r--fs/gfs2/glops.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index f79ef9525e33..f15b4c57c4bd 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -467,17 +467,25 @@ static int inode_go_lock(struct gfs2_holder *gh)
467 * 467 *
468 */ 468 */
469 469
470static void inode_go_dump(struct seq_file *seq, const struct gfs2_glock *gl) 470static void inode_go_dump(struct seq_file *seq, struct gfs2_glock *gl)
471{ 471{
472 const struct gfs2_inode *ip = gl->gl_object; 472 struct gfs2_inode *ip = gl->gl_object;
473 struct inode *inode = &ip->i_inode;
474 unsigned long nrpages;
475
473 if (ip == NULL) 476 if (ip == NULL)
474 return; 477 return;
475 gfs2_print_dbg(seq, " I: n:%llu/%llu t:%u f:0x%02lx d:0x%08x s:%llu\n", 478
479 xa_lock_irq(&inode->i_data.i_pages);
480 nrpages = inode->i_data.nrpages;
481 xa_unlock_irq(&inode->i_data.i_pages);
482
483 gfs2_print_dbg(seq, " I: n:%llu/%llu t:%u f:0x%02lx d:0x%08x s:%llu p:%lu\n",
476 (unsigned long long)ip->i_no_formal_ino, 484 (unsigned long long)ip->i_no_formal_ino,
477 (unsigned long long)ip->i_no_addr, 485 (unsigned long long)ip->i_no_addr,
478 IF2DT(ip->i_inode.i_mode), ip->i_flags, 486 IF2DT(ip->i_inode.i_mode), ip->i_flags,
479 (unsigned int)ip->i_diskflags, 487 (unsigned int)ip->i_diskflags,
480 (unsigned long long)i_size_read(&ip->i_inode)); 488 (unsigned long long)i_size_read(inode), nrpages);
481} 489}
482 490
483/** 491/**