• Home
  • Raw
  • Download

Lines Matching refs:ip

33 	struct xfs_inode	*ip,  in xfs_init_local_fork()  argument
38 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_init_local_fork()
48 zero_terminate = S_ISLNK(VFS_I(ip)->i_mode); in xfs_init_local_fork()
69 struct xfs_inode *ip, in xfs_iformat_local() argument
79 if (unlikely(size > XFS_DFORK_SIZE(dip, ip->i_mount, whichfork))) { in xfs_iformat_local()
80 xfs_warn(ip->i_mount, in xfs_iformat_local()
82 (unsigned long long) ip->i_ino, size, in xfs_iformat_local()
83 XFS_DFORK_SIZE(dip, ip->i_mount, whichfork)); in xfs_iformat_local()
84 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_local()
90 xfs_init_local_fork(ip, whichfork, XFS_DFORK_PTR(dip, whichfork), size); in xfs_iformat_local()
100 struct xfs_inode *ip, in xfs_iformat_extents() argument
104 struct xfs_mount *mp = ip->i_mount; in xfs_iformat_extents()
105 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_extents()
119 xfs_warn(ip->i_mount, "corrupt inode %llu ((a)extents = %llu).", in xfs_iformat_extents()
120 ip->i_ino, nex); in xfs_iformat_extents()
121 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_extents()
138 fa = xfs_bmap_validate_extent(ip, whichfork, &new); in xfs_iformat_extents()
140 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_extents()
146 xfs_iext_insert(ip, &icur, &new, state); in xfs_iformat_extents()
147 trace_xfs_read_extent(ip, &icur, state, _THIS_IP_); in xfs_iformat_extents()
164 struct xfs_inode *ip, in xfs_iformat_btree() argument
168 struct xfs_mount *mp = ip->i_mount; in xfs_iformat_btree()
176 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_btree()
189 if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || in xfs_iformat_btree()
193 ifp->if_nextents > ip->i_nblocks) || in xfs_iformat_btree()
196 (unsigned long long) ip->i_ino); in xfs_iformat_btree()
197 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_btree()
210 xfs_bmdr_to_bmbt(ip, dfp, XFS_DFORK_SIZE(dip, ip->i_mount, whichfork), in xfs_iformat_btree()
221 struct xfs_inode *ip, in xfs_iformat_data_fork() argument
224 struct inode *inode = VFS_I(ip); in xfs_iformat_data_fork()
231 ip->i_df.if_format = dip->di_format; in xfs_iformat_data_fork()
232 ip->i_df.if_nextents = xfs_dfork_data_extents(dip); in xfs_iformat_data_fork()
239 ip->i_disk_size = 0; in xfs_iformat_data_fork()
245 switch (ip->i_df.if_format) { in xfs_iformat_data_fork()
247 error = xfs_iformat_local(ip, dip, XFS_DATA_FORK, in xfs_iformat_data_fork()
250 error = xfs_ifork_verify_local_data(ip); in xfs_iformat_data_fork()
253 return xfs_iformat_extents(ip, dip, XFS_DATA_FORK); in xfs_iformat_data_fork()
255 return xfs_iformat_btree(ip, dip, XFS_DATA_FORK); in xfs_iformat_data_fork()
257 xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, in xfs_iformat_data_fork()
263 xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, dip, in xfs_iformat_data_fork()
281 struct xfs_inode *ip, in xfs_ifork_init_attr() argument
285 ip->i_af.if_format = format; in xfs_ifork_init_attr()
286 ip->i_af.if_nextents = nextents; in xfs_ifork_init_attr()
291 struct xfs_inode *ip) in xfs_ifork_zap_attr() argument
293 xfs_idestroy_fork(&ip->i_af); in xfs_ifork_zap_attr()
294 memset(&ip->i_af, 0, sizeof(struct xfs_ifork)); in xfs_ifork_zap_attr()
295 ip->i_af.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_ifork_zap_attr()
300 struct xfs_inode *ip, in xfs_iformat_attr_fork() argument
310 xfs_ifork_init_attr(ip, dip->di_aformat, naextents); in xfs_iformat_attr_fork()
312 switch (ip->i_af.if_format) { in xfs_iformat_attr_fork()
314 error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, in xfs_iformat_attr_fork()
317 error = xfs_ifork_verify_local_attr(ip); in xfs_iformat_attr_fork()
320 error = xfs_iformat_extents(ip, dip, XFS_ATTR_FORK); in xfs_iformat_attr_fork()
323 error = xfs_iformat_btree(ip, dip, XFS_ATTR_FORK); in xfs_iformat_attr_fork()
326 xfs_inode_verifier_error(ip, error, __func__, dip, in xfs_iformat_attr_fork()
333 xfs_ifork_zap_attr(ip); in xfs_iformat_attr_fork()
357 xfs_inode_t *ip, in xfs_iroot_realloc() argument
361 struct xfs_mount *mp = ip->i_mount; in xfs_iroot_realloc()
377 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iroot_realloc()
407 xfs_inode_fork_size(ip, whichfork)); in xfs_iroot_realloc()
431 XFS_BMBT_BLOCK_LEN(ip->i_mount)); in xfs_iroot_realloc()
461 xfs_inode_fork_size(ip, whichfork)); in xfs_iroot_realloc()
483 struct xfs_inode *ip, in xfs_idata_realloc() argument
487 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_idata_realloc()
491 ASSERT(new_size <= xfs_inode_fork_size(ip, whichfork)); in xfs_idata_realloc()
541 struct xfs_inode *ip, in xfs_iextents_copy() argument
546 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iextents_copy()
551 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL | XFS_ILOCK_SHARED)); in xfs_iextents_copy()
557 ASSERT(xfs_bmap_validate_extent(ip, whichfork, &rec) == NULL); in xfs_iextents_copy()
559 trace_xfs_write_extent(ip, &icur, state, _RET_IP_); in xfs_iextents_copy()
581 struct xfs_inode *ip, in xfs_iflush_fork() argument
598 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iflush_fork()
608 mp = ip->i_mount; in xfs_iflush_fork()
614 ASSERT(ifp->if_bytes <= xfs_inode_fork_size(ip, whichfork)); in xfs_iflush_fork()
623 (void)xfs_iextents_copy(ip, (xfs_bmbt_rec_t *)cp, in xfs_iflush_fork()
633 xfs_inode_fork_size(ip, whichfork)); in xfs_iflush_fork()
644 linux_to_xfs_dev_t(VFS_I(ip)->i_rdev)); in xfs_iflush_fork()
657 struct xfs_inode *ip, in xfs_iext_state_to_fork() argument
661 return ip->i_cowfp; in xfs_iext_state_to_fork()
663 return &ip->i_af; in xfs_iext_state_to_fork()
664 return &ip->i_df; in xfs_iext_state_to_fork()
672 struct xfs_inode *ip) in xfs_ifork_init_cow() argument
674 if (ip->i_cowfp) in xfs_ifork_init_cow()
677 ip->i_cowfp = kmem_cache_zalloc(xfs_ifork_cache, in xfs_ifork_init_cow()
679 ip->i_cowfp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_ifork_init_cow()
685 struct xfs_inode *ip) in xfs_ifork_verify_local_data() argument
689 switch (VFS_I(ip)->i_mode & S_IFMT) { in xfs_ifork_verify_local_data()
691 fa = xfs_dir2_sf_verify(ip); in xfs_ifork_verify_local_data()
694 fa = xfs_symlink_shortform_verify(ip); in xfs_ifork_verify_local_data()
701 xfs_inode_verifier_error(ip, -EFSCORRUPTED, "data fork", in xfs_ifork_verify_local_data()
702 ip->i_df.if_u1.if_data, ip->i_df.if_bytes, fa); in xfs_ifork_verify_local_data()
712 struct xfs_inode *ip) in xfs_ifork_verify_local_attr() argument
714 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr()
717 if (!xfs_inode_has_attr_fork(ip)) in xfs_ifork_verify_local_attr()
720 fa = xfs_attr_shortform_verify(ip); in xfs_ifork_verify_local_attr()
723 xfs_inode_verifier_error(ip, -EFSCORRUPTED, "attr fork", in xfs_ifork_verify_local_attr()
733 struct xfs_inode *ip, in xfs_iext_count_may_overflow() argument
737 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iext_count_may_overflow()
744 max_exts = xfs_iext_max_nextents(xfs_inode_has_large_extent_counts(ip), in xfs_iext_count_may_overflow()
747 if (XFS_TEST_ERROR(false, ip->i_mount, XFS_ERRTAG_REDUCE_MAX_IEXTENTS)) in xfs_iext_count_may_overflow()
765 struct xfs_inode *ip, in xfs_iext_count_upgrade() argument
770 if (!xfs_has_large_extent_counts(ip->i_mount) || in xfs_iext_count_upgrade()
771 xfs_inode_has_large_extent_counts(ip) || in xfs_iext_count_upgrade()
772 XFS_TEST_ERROR(false, ip->i_mount, XFS_ERRTAG_REDUCE_MAX_IEXTENTS)) in xfs_iext_count_upgrade()
775 ip->i_diflags2 |= XFS_DIFLAG2_NREXT64; in xfs_iext_count_upgrade()
776 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_iext_count_upgrade()