svn commit: r345032 - head/sys/ufs/ufs
Kirk McKusick
mckusick at FreeBSD.org
Mon Mar 11 22:05:35 UTC 2019
Author: mckusick
Date: Mon Mar 11 22:05:34 2019
New Revision: 345032
URL: https://svnweb.freebsd.org/changeset/base/345032
Log:
Augment the UFS filesystem specific print function (called by the
kernel vn_printf() routine when printing out vnodes associated with
a UFS filesystem) to also include the inode's link count, effective
link count, generation number, owner, group, flags, size, and for
UFS2 filesystems, the extent size.
Sponsored by: Netflix
Modified:
head/sys/ufs/ufs/inode.h
head/sys/ufs/ufs/ufs_vnops.c
Modified: head/sys/ufs/ufs/inode.h
==============================================================================
--- head/sys/ufs/ufs/inode.h Mon Mar 11 21:56:35 2019 (r345031)
+++ head/sys/ufs/ufs/inode.h Mon Mar 11 22:05:34 2019 (r345032)
@@ -134,6 +134,10 @@ struct inode {
#define IN_UFS2 0x0400 /* UFS2 vs UFS1 */
+#define PRINT_INODE_FLAGS "\20\20b16\17b15\16b14\15b13" \
+ "\14b12\13is_ufs2\12truncated\11ea_lockwait\10ea_locked" \
+ "\7lazyaccess\6lazymod\5needsync\4modified\3update\2change\1access"
+
#define i_dirhash i_un.dirhash
#define i_snapblklist i_un.snapblklist
#define i_din1 dinode_u.din1
Modified: head/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vnops.c Mon Mar 11 21:56:35 2019 (r345031)
+++ head/sys/ufs/ufs/ufs_vnops.c Mon Mar 11 22:05:34 2019 (r345032)
@@ -2338,6 +2338,13 @@ ufs_print(ap)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
+ printf("\tnlink=%d, effnlink=%d, size=%jd", ip->i_nlink,
+ ip->i_effnlink, (intmax_t)ip->i_size);
+ if (I_IS_UFS2(ip))
+ printf(", extsize %d", ip->i_din2->di_extsize);
+ printf("\n\tgeneration=%jx, uid=%d, gid=%d, flags=0x%b\n",
+ (uintmax_t)ip->i_gen, ip->i_uid, ip->i_gid,
+ (u_int)ip->i_flags, PRINT_INODE_FLAGS);
printf("\tino %lu, on dev %s", (u_long)ip->i_number,
devtoname(ITODEV(ip)));
if (vp->v_type == VFIFO)
More information about the svn-src-all
mailing list