Lines Matching refs:dip

37 	xfs_dinode_t	*dip;  in xfs_inobp_check()  local
42 dip = xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize); in xfs_inobp_check()
43 if (!dip->di_next_unlinked) { in xfs_inobp_check()
95 xfs_dinode_t *dip; in xfs_inode_buf_verify() local
98 dip = xfs_buf_offset(bp, (i << mp->m_sb.sb_inodelog)); in xfs_inode_buf_verify()
99 unlinked_ino = be32_to_cpu(dip->di_next_unlinked); in xfs_inode_buf_verify()
100 di_ok = dip->di_magic == cpu_to_be16(XFS_DINODE_MAGIC) && in xfs_inode_buf_verify()
101 xfs_dinode_good_version(mp, dip->di_version) && in xfs_inode_buf_verify()
116 be16_to_cpu(dip->di_magic)); in xfs_inode_buf_verify()
119 __func__, dip, sizeof(*dip), in xfs_inode_buf_verify()
379 struct xfs_dinode *dip, in xfs_dinode_verify_fork() argument
383 uint32_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork); in xfs_dinode_verify_fork()
385 switch (XFS_DFORK_FORMAT(dip, whichfork)) { in xfs_dinode_verify_fork()
391 if (S_ISREG(be16_to_cpu(dip->di_mode))) in xfs_dinode_verify_fork()
393 if (be64_to_cpu(dip->di_size) > in xfs_dinode_verify_fork()
394 XFS_DFORK_SIZE(dip, mp, whichfork)) in xfs_dinode_verify_fork()
401 if (di_nextents > XFS_DFORK_MAXEXT(dip, mp, whichfork)) in xfs_dinode_verify_fork()
420 struct xfs_dinode *dip, in xfs_dinode_verify_forkoff() argument
423 if (!XFS_DFORK_Q(dip)) in xfs_dinode_verify_forkoff()
426 switch (dip->di_format) { in xfs_dinode_verify_forkoff()
428 if (dip->di_forkoff != (roundup(sizeof(xfs_dev_t), 8) >> 3)) in xfs_dinode_verify_forkoff()
434 if (dip->di_forkoff >= (XFS_LITINO(mp, dip->di_version) >> 3)) in xfs_dinode_verify_forkoff()
447 struct xfs_dinode *dip) in xfs_dinode_verify() argument
455 if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC)) in xfs_dinode_verify()
459 if (dip->di_version >= 3) { in xfs_dinode_verify()
462 if (!xfs_verify_cksum((char *)dip, mp->m_sb.sb_inodesize, in xfs_dinode_verify()
465 if (be64_to_cpu(dip->di_ino) != ino) in xfs_dinode_verify()
467 if (!uuid_equal(&dip->di_uuid, &mp->m_sb.sb_meta_uuid)) in xfs_dinode_verify()
472 di_size = be64_to_cpu(dip->di_size); in xfs_dinode_verify()
476 mode = be16_to_cpu(dip->di_mode); in xfs_dinode_verify()
486 be32_to_cpu(dip->di_nextents) + be16_to_cpu(dip->di_anextents) > in xfs_dinode_verify()
487 be64_to_cpu(dip->di_nblocks)) in xfs_dinode_verify()
490 if (mode && XFS_DFORK_BOFF(dip) > mp->m_sb.sb_inodesize) in xfs_dinode_verify()
493 flags = be16_to_cpu(dip->di_flags); in xfs_dinode_verify()
499 fa = xfs_dinode_verify_forkoff(dip, mp); in xfs_dinode_verify()
509 if (dip->di_format != XFS_DINODE_FMT_DEV) in xfs_dinode_verify()
515 fa = xfs_dinode_verify_fork(dip, mp, XFS_DATA_FORK); in xfs_dinode_verify()
526 if (XFS_DFORK_Q(dip)) { in xfs_dinode_verify()
527 fa = xfs_dinode_verify_fork(dip, mp, XFS_ATTR_FORK); in xfs_dinode_verify()
537 switch (dip->di_aformat) { in xfs_dinode_verify()
544 if (dip->di_anextents) in xfs_dinode_verify()
549 fa = xfs_inode_validate_extsize(mp, be32_to_cpu(dip->di_extsize), in xfs_dinode_verify()
555 if (dip->di_version < 3) in xfs_dinode_verify()
558 flags2 = be64_to_cpu(dip->di_flags2); in xfs_dinode_verify()
578 fa = xfs_inode_validate_cowextsize(mp, be32_to_cpu(dip->di_cowextsize), in xfs_dinode_verify()
589 struct xfs_dinode *dip) in xfs_dinode_calc_crc() argument
593 if (dip->di_version < 3) in xfs_dinode_calc_crc()
597 crc = xfs_start_cksum_update((char *)dip, mp->m_sb.sb_inodesize, in xfs_dinode_calc_crc()
599 dip->di_crc = xfs_end_cksum(crc); in xfs_dinode_calc_crc()
622 xfs_dinode_t *dip; in xfs_iread() local
647 error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &dip, &bp, 0, iget_flags); in xfs_iread()
652 fa = xfs_dinode_verify(mp, ip->i_ino, dip); in xfs_iread()
654 xfs_inode_verifier_error(ip, -EFSCORRUPTED, "dinode", dip, in xfs_iread()
655 sizeof(*dip), fa); in xfs_iread()
667 if (dip->di_mode) { in xfs_iread()
668 xfs_inode_from_disk(ip, dip); in xfs_iread()
669 error = xfs_iformat_fork(ip, dip); in xfs_iread()
682 ip->i_d.di_version = dip->di_version; in xfs_iread()
683 VFS_I(ip)->i_generation = be32_to_cpu(dip->di_gen); in xfs_iread()
684 ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); in xfs_iread()