Lines Matching refs:dip

105 	xfs_dinode_t	*dip;  in xfs_inobp_check()  local
110 dip = (xfs_dinode_t *)xfs_buf_offset(bp, in xfs_inobp_check()
112 if (!dip->di_next_unlinked) { in xfs_inobp_check()
116 ASSERT(dip->di_next_unlinked); in xfs_inobp_check()
166 xfs_dinode_t *dip; in xfs_imap_to_bp() local
168 dip = (xfs_dinode_t *)xfs_buf_offset(bp, in xfs_imap_to_bp()
170 di_ok = be16_to_cpu(dip->di_magic) == XFS_DINODE_MAGIC && in xfs_imap_to_bp()
171 XFS_DINODE_GOOD_VERSION(dip->di_version); in xfs_imap_to_bp()
180 XFS_ERRLEVEL_HIGH, mp, dip); in xfs_imap_to_bp()
185 be16_to_cpu(dip->di_magic)); in xfs_imap_to_bp()
305 xfs_dinode_t *dip) in xfs_iformat() argument
315 if (unlikely(be32_to_cpu(dip->di_nextents) + in xfs_iformat()
316 be16_to_cpu(dip->di_anextents) > in xfs_iformat()
317 be64_to_cpu(dip->di_nblocks))) { in xfs_iformat()
321 (int)(be32_to_cpu(dip->di_nextents) + in xfs_iformat()
322 be16_to_cpu(dip->di_anextents)), in xfs_iformat()
324 be64_to_cpu(dip->di_nblocks)); in xfs_iformat()
326 ip->i_mount, dip); in xfs_iformat()
330 if (unlikely(dip->di_forkoff > ip->i_mount->m_sb.sb_inodesize)) { in xfs_iformat()
333 dip->di_forkoff); in xfs_iformat()
335 ip->i_mount, dip); in xfs_iformat()
345 XFS_ERRLEVEL_LOW, ip->i_mount, dip); in xfs_iformat()
354 if (unlikely(dip->di_format != XFS_DINODE_FMT_DEV)) { in xfs_iformat()
356 ip->i_mount, dip); in xfs_iformat()
361 ip->i_df.if_u2.if_rdev = xfs_dinode_get_rdev(dip); in xfs_iformat()
367 switch (dip->di_format) { in xfs_iformat()
372 if (unlikely((be16_to_cpu(dip->di_mode) & S_IFMT) == S_IFREG)) { in xfs_iformat()
378 ip->i_mount, dip); in xfs_iformat()
382 di_size = be64_to_cpu(dip->di_size); in xfs_iformat()
383 if (unlikely(di_size > XFS_DFORK_DSIZE(dip, ip->i_mount))) { in xfs_iformat()
390 ip->i_mount, dip); in xfs_iformat()
395 error = xfs_iformat_local(ip, dip, XFS_DATA_FORK, size); in xfs_iformat()
398 error = xfs_iformat_extents(ip, dip, XFS_DATA_FORK); in xfs_iformat()
401 error = xfs_iformat_btree(ip, dip, XFS_DATA_FORK); in xfs_iformat()
417 if (!XFS_DFORK_Q(dip)) in xfs_iformat()
423 switch (dip->di_aformat) { in xfs_iformat()
425 atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); in xfs_iformat()
435 ip->i_mount, dip); in xfs_iformat()
439 error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size); in xfs_iformat()
442 error = xfs_iformat_extents(ip, dip, XFS_ATTR_FORK); in xfs_iformat()
445 error = xfs_iformat_btree(ip, dip, XFS_ATTR_FORK); in xfs_iformat()
472 xfs_dinode_t *dip, in xfs_iformat_local() argument
484 if (unlikely(size > XFS_DFORK_SIZE(dip, ip->i_mount, whichfork))) { in xfs_iformat_local()
488 XFS_DFORK_SIZE(dip, ip->i_mount, whichfork)); in xfs_iformat_local()
490 ip->i_mount, dip); in xfs_iformat_local()
506 memcpy(ifp->if_u1.if_data, XFS_DFORK_PTR(dip, whichfork), size); in xfs_iformat_local()
524 xfs_dinode_t *dip, in xfs_iformat_extents() argument
534 nex = XFS_DFORK_NEXTENTS(dip, whichfork); in xfs_iformat_extents()
542 if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, ip->i_mount, whichfork))) { in xfs_iformat_extents()
546 ip->i_mount, dip); in xfs_iformat_extents()
560 dp = (xfs_bmbt_rec_t *) XFS_DFORK_PTR(dip, whichfork); in xfs_iformat_extents()
593 xfs_dinode_t *dip, in xfs_iformat_btree() argument
603 dfp = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork); in xfs_iformat_btree()
616 XFS_DFORK_SIZE(dip, ip->i_mount, whichfork) in xfs_iformat_btree()
621 ip->i_mount, dip); in xfs_iformat_btree()
633 XFS_DFORK_SIZE(dip, ip->i_mount, whichfork), in xfs_iformat_btree()
765 xfs_dinode_t *dip) in xfs_dic2xflags() argument
767 return _xfs_dic2xflags(be16_to_cpu(dip->di_flags)) | in xfs_dic2xflags()
768 (XFS_DFORK_Q(dip) ? XFS_XFLAG_HASATTR : 0); in xfs_dic2xflags()
782 xfs_dinode_t *dip; in xfs_iread() local
799 dip = (xfs_dinode_t *)xfs_buf_offset(bp, ip->i_imap.im_boffset); in xfs_iread()
805 if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC) { in xfs_iread()
809 __func__, be16_to_cpu(dip->di_magic), XFS_DINODE_MAGIC); in xfs_iread()
822 if (dip->di_mode) { in xfs_iread()
823 xfs_dinode_from_disk(&ip->i_d, dip); in xfs_iread()
824 error = xfs_iformat(ip, dip); in xfs_iread()
833 ip->i_d.di_magic = be16_to_cpu(dip->di_magic); in xfs_iread()
834 ip->i_d.di_version = dip->di_version; in xfs_iread()
835 ip->i_d.di_gen = be32_to_cpu(dip->di_gen); in xfs_iread()
836 ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); in xfs_iread()
1688 xfs_dinode_t *dip; in xfs_iunlink() local
1728 error = xfs_itobp(mp, tp, ip, &dip, &ibp, XBF_LOCK); in xfs_iunlink()
1732 ASSERT(be32_to_cpu(dip->di_next_unlinked) == NULLAGINO); in xfs_iunlink()
1734 dip->di_next_unlinked = agi->agi_unlinked[bucket_index]; in xfs_iunlink()
1766 xfs_dinode_t *dip; in xfs_iunlink_remove() local
1810 error = xfs_itobp(mp, tp, ip, &dip, &ibp, XBF_LOCK); in xfs_iunlink_remove()
1816 next_agino = be32_to_cpu(dip->di_next_unlinked); in xfs_iunlink_remove()
1819 dip->di_next_unlinked = cpu_to_be32(NULLAGINO); in xfs_iunlink_remove()
1871 error = xfs_itobp(mp, tp, ip, &dip, &ibp, XBF_LOCK); in xfs_iunlink_remove()
1877 next_agino = be32_to_cpu(dip->di_next_unlinked); in xfs_iunlink_remove()
1881 dip->di_next_unlinked = cpu_to_be32(NULLAGINO); in xfs_iunlink_remove()
2086 xfs_dinode_t *dip; in xfs_ifree() local
2126 error = xfs_itobp(ip->i_mount, tp, ip, &dip, &ibp, XBF_LOCK); in xfs_ifree()
2142 dip->di_mode = 0; in xfs_ifree()
2517 xfs_dinode_t *dip, in xfs_iflush_fork() argument
2546 cp = XFS_DFORK_PTR(dip, whichfork); in xfs_iflush_fork()
2582 XFS_DFORK_SIZE(dip, mp, whichfork)); in xfs_iflush_fork()
2589 xfs_dinode_put_rdev(dip, ip->i_df.if_u2.if_rdev); in xfs_iflush_fork()
2596 memcpy(XFS_DFORK_DPTR(dip), in xfs_iflush_fork()
2776 xfs_dinode_t *dip; in xfs_iflush() local
2837 error = xfs_itobp(mp, NULL, ip, &dip, &bp, in xfs_iflush()
2890 xfs_dinode_t *dip; in xfs_iflush_int() local
2905 dip = (xfs_dinode_t *)xfs_buf_offset(bp, ip->i_imap.im_boffset); in xfs_iflush_int()
2927 if (XFS_TEST_ERROR(be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC, in xfs_iflush_int()
2931 __func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip); in xfs_iflush_int()
2994 xfs_dinode_to_disk(dip, &ip->i_d); in xfs_iflush_int()
3013 dip->di_onlink = cpu_to_be16(ip->i_d.di_nlink); in xfs_iflush_int()
3021 dip->di_version = 2; in xfs_iflush_int()
3023 dip->di_onlink = 0; in xfs_iflush_int()
3025 memset(&(dip->di_pad[0]), 0, in xfs_iflush_int()
3026 sizeof(dip->di_pad)); in xfs_iflush_int()
3031 xfs_iflush_fork(ip, dip, iip, XFS_DATA_FORK, bp); in xfs_iflush_int()
3033 xfs_iflush_fork(ip, dip, iip, XFS_ATTR_FORK, bp); in xfs_iflush_int()