Lines Matching refs:dip
54 struct xfs_dinode *dip; in xfs_inode_buf_verify() local
58 dip = xfs_buf_offset(bp, (i << mp->m_sb.sb_inodelog)); in xfs_inode_buf_verify()
59 unlinked_ino = be32_to_cpu(dip->di_next_unlinked); in xfs_inode_buf_verify()
60 di_ok = xfs_verify_magic16(bp, dip->di_magic) && in xfs_inode_buf_verify()
61 xfs_dinode_good_version(mp, dip->di_version) && in xfs_inode_buf_verify()
75 be16_to_cpu(dip->di_magic)); in xfs_inode_buf_verify()
78 __func__, dip, sizeof(*dip), in xfs_inode_buf_verify()
160 struct xfs_dinode *dip, in xfs_inode_from_disk_ts() argument
166 if (xfs_dinode_has_bigtime(dip)) in xfs_inode_from_disk_ts()
362 struct xfs_dinode *dip, in xfs_dinode_verify_fork() argument
368 mode_t mode = be16_to_cpu(dip->di_mode); in xfs_dinode_verify_fork()
369 uint32_t fork_size = XFS_DFORK_SIZE(dip, mp, whichfork); in xfs_dinode_verify_fork()
370 uint32_t fork_format = XFS_DFORK_FORMAT(dip, whichfork); in xfs_dinode_verify_fork()
372 di_nextents = xfs_dfork_nextents(dip, whichfork); in xfs_dinode_verify_fork()
387 if (dip->di_size && in xfs_dinode_verify_fork()
388 be64_to_cpu(dip->di_size) <= fork_size && in xfs_dinode_verify_fork()
400 if (be64_to_cpu(dip->di_size) <= fork_size && in xfs_dinode_verify_fork()
411 if (be64_to_cpu(dip->di_size) > fork_size && in xfs_dinode_verify_fork()
427 if (di_nextents > XFS_DFORK_MAXEXT(dip, mp, whichfork)) in xfs_dinode_verify_fork()
432 xfs_dinode_has_large_extent_counts(dip), in xfs_dinode_verify_fork()
445 struct xfs_dinode *dip, in xfs_dinode_verify_forkoff() argument
448 if (!dip->di_forkoff) in xfs_dinode_verify_forkoff()
451 switch (dip->di_format) { in xfs_dinode_verify_forkoff()
453 if (dip->di_forkoff != (roundup(sizeof(xfs_dev_t), 8) >> 3)) in xfs_dinode_verify_forkoff()
459 if (dip->di_forkoff >= (XFS_LITINO(mp) >> 3)) in xfs_dinode_verify_forkoff()
471 struct xfs_dinode *dip) in xfs_dinode_verify_nrext64() argument
473 if (xfs_dinode_has_large_extent_counts(dip)) { in xfs_dinode_verify_nrext64()
476 if (dip->di_nrext64_pad != 0) in xfs_dinode_verify_nrext64()
478 } else if (dip->di_version >= 3) { in xfs_dinode_verify_nrext64()
479 if (dip->di_v3_pad != 0) in xfs_dinode_verify_nrext64()
490 struct xfs_dinode *dip) in xfs_dinode_verify() argument
501 if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC)) in xfs_dinode_verify()
505 if (dip->di_version >= 3) { in xfs_dinode_verify()
508 if (!xfs_verify_cksum((char *)dip, mp->m_sb.sb_inodesize, in xfs_dinode_verify()
511 if (be64_to_cpu(dip->di_ino) != ino) in xfs_dinode_verify()
513 if (!uuid_equal(&dip->di_uuid, &mp->m_sb.sb_meta_uuid)) in xfs_dinode_verify()
526 if (dip->di_version >= 2) { in xfs_dinode_verify()
527 if (dip->di_onlink) in xfs_dinode_verify()
532 di_size = be64_to_cpu(dip->di_size); in xfs_dinode_verify()
536 mode = be16_to_cpu(dip->di_mode); in xfs_dinode_verify()
545 if (dip->di_version > 1) { in xfs_dinode_verify()
546 if (dip->di_nlink) in xfs_dinode_verify()
549 if (dip->di_onlink) in xfs_dinode_verify()
554 fa = xfs_dinode_verify_nrext64(mp, dip); in xfs_dinode_verify()
558 nextents = xfs_dfork_data_extents(dip); in xfs_dinode_verify()
559 naextents = xfs_dfork_attr_extents(dip); in xfs_dinode_verify()
560 nblocks = be64_to_cpu(dip->di_nblocks); in xfs_dinode_verify()
572 if (mode && XFS_DFORK_BOFF(dip) > mp->m_sb.sb_inodesize) in xfs_dinode_verify()
575 flags = be16_to_cpu(dip->di_flags); in xfs_dinode_verify()
581 fa = xfs_dinode_verify_forkoff(dip, mp); in xfs_dinode_verify()
591 if (dip->di_format != XFS_DINODE_FMT_DEV) in xfs_dinode_verify()
597 fa = xfs_dinode_verify_fork(dip, mp, XFS_DATA_FORK); in xfs_dinode_verify()
608 if (dip->di_forkoff) { in xfs_dinode_verify()
609 fa = xfs_dinode_verify_fork(dip, mp, XFS_ATTR_FORK); in xfs_dinode_verify()
619 switch (dip->di_aformat) { in xfs_dinode_verify()
631 fa = xfs_inode_validate_extsize(mp, be32_to_cpu(dip->di_extsize), in xfs_dinode_verify()
637 if (dip->di_version < 3) in xfs_dinode_verify()
640 flags2 = be64_to_cpu(dip->di_flags2); in xfs_dinode_verify()
656 fa = xfs_inode_validate_cowextsize(mp, be32_to_cpu(dip->di_cowextsize), in xfs_dinode_verify()
662 if (xfs_dinode_has_bigtime(dip) && in xfs_dinode_verify()
672 struct xfs_dinode *dip) in xfs_dinode_calc_crc() argument
676 if (dip->di_version < 3) in xfs_dinode_calc_crc()
680 crc = xfs_start_cksum_update((char *)dip, mp->m_sb.sb_inodesize, in xfs_dinode_calc_crc()
682 dip->di_crc = xfs_end_cksum(crc); in xfs_dinode_calc_crc()