Lines Matching refs:ip

35 	struct xfs_inode	*ip,  in xfs_init_local_fork()  argument
40 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_init_local_fork()
50 zero_terminate = S_ISLNK(VFS_I(ip)->i_mode); in xfs_init_local_fork()
75 struct xfs_inode *ip, in xfs_iformat_local() argument
85 if (unlikely(size > XFS_DFORK_SIZE(dip, ip->i_mount, whichfork))) { in xfs_iformat_local()
86 xfs_warn(ip->i_mount, in xfs_iformat_local()
88 (unsigned long long) ip->i_ino, size, in xfs_iformat_local()
89 XFS_DFORK_SIZE(dip, ip->i_mount, whichfork)); in xfs_iformat_local()
90 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_local()
93 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iformat_local()
97 xfs_init_local_fork(ip, whichfork, XFS_DFORK_PTR(dip, whichfork), size); in xfs_iformat_local()
107 struct xfs_inode *ip, in xfs_iformat_extents() argument
111 struct xfs_mount *mp = ip->i_mount; in xfs_iformat_extents()
112 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_extents()
126 xfs_warn(ip->i_mount, "corrupt inode %llu ((a)extents = %llu).", in xfs_iformat_extents()
127 ip->i_ino, nex); in xfs_iformat_extents()
128 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_extents()
131 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iformat_extents()
146 fa = xfs_bmap_validate_extent(ip, whichfork, &new); in xfs_iformat_extents()
148 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_extents()
151 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iformat_extents()
152 return xfs_bmap_complain_bad_rec(ip, whichfork, in xfs_iformat_extents()
156 xfs_iext_insert(ip, &icur, &new, state); in xfs_iformat_extents()
157 trace_xfs_read_extent(ip, &icur, state, _THIS_IP_); in xfs_iformat_extents()
174 struct xfs_inode *ip, in xfs_iformat_btree() argument
178 struct xfs_mount *mp = ip->i_mount; in xfs_iformat_btree()
186 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_btree()
199 if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || in xfs_iformat_btree()
203 ifp->if_nextents > ip->i_nblocks) || in xfs_iformat_btree()
206 (unsigned long long) ip->i_ino); in xfs_iformat_btree()
207 xfs_inode_verifier_error(ip, -EFSCORRUPTED, in xfs_iformat_btree()
210 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iformat_btree()
222 xfs_bmdr_to_bmbt(ip, dfp, XFS_DFORK_SIZE(dip, ip->i_mount, whichfork), in xfs_iformat_btree()
233 struct xfs_inode *ip, in xfs_iformat_data_fork() argument
236 struct inode *inode = VFS_I(ip); in xfs_iformat_data_fork()
246 ip->i_df.if_format = dip->di_format; in xfs_iformat_data_fork()
247 ip->i_df.if_nextents = xfs_dfork_data_extents(dip); in xfs_iformat_data_fork()
248 smp_store_release(&ip->i_df.if_needextents, in xfs_iformat_data_fork()
249 ip->i_df.if_format == XFS_DINODE_FMT_BTREE ? 1 : 0); in xfs_iformat_data_fork()
256 ip->i_disk_size = 0; in xfs_iformat_data_fork()
262 switch (ip->i_df.if_format) { in xfs_iformat_data_fork()
264 error = xfs_iformat_local(ip, dip, XFS_DATA_FORK, in xfs_iformat_data_fork()
267 error = xfs_ifork_verify_local_data(ip); in xfs_iformat_data_fork()
270 return xfs_iformat_extents(ip, dip, XFS_DATA_FORK); in xfs_iformat_data_fork()
272 return xfs_iformat_btree(ip, dip, XFS_DATA_FORK); in xfs_iformat_data_fork()
274 xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, in xfs_iformat_data_fork()
276 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iformat_data_fork()
281 xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, dip, in xfs_iformat_data_fork()
283 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iformat_data_fork()
299 struct xfs_inode *ip, in xfs_ifork_init_attr() argument
310 ip->i_af.if_format = format; in xfs_ifork_init_attr()
311 ip->i_af.if_nextents = nextents; in xfs_ifork_init_attr()
312 smp_store_release(&ip->i_af.if_needextents, in xfs_ifork_init_attr()
313 ip->i_af.if_format == XFS_DINODE_FMT_BTREE ? 1 : 0); in xfs_ifork_init_attr()
318 struct xfs_inode *ip) in xfs_ifork_zap_attr() argument
320 xfs_idestroy_fork(&ip->i_af); in xfs_ifork_zap_attr()
321 memset(&ip->i_af, 0, sizeof(struct xfs_ifork)); in xfs_ifork_zap_attr()
322 ip->i_af.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_ifork_zap_attr()
327 struct xfs_inode *ip, in xfs_iformat_attr_fork() argument
337 xfs_ifork_init_attr(ip, dip->di_aformat, naextents); in xfs_iformat_attr_fork()
339 switch (ip->i_af.if_format) { in xfs_iformat_attr_fork()
341 error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, in xfs_iformat_attr_fork()
344 error = xfs_ifork_verify_local_attr(ip); in xfs_iformat_attr_fork()
347 error = xfs_iformat_extents(ip, dip, XFS_ATTR_FORK); in xfs_iformat_attr_fork()
350 error = xfs_iformat_btree(ip, dip, XFS_ATTR_FORK); in xfs_iformat_attr_fork()
353 xfs_inode_verifier_error(ip, error, __func__, dip, in xfs_iformat_attr_fork()
355 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iformat_attr_fork()
361 xfs_ifork_zap_attr(ip); in xfs_iformat_attr_fork()
385 xfs_inode_t *ip, in xfs_iroot_realloc() argument
389 struct xfs_mount *mp = ip->i_mount; in xfs_iroot_realloc()
405 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iroot_realloc()
436 xfs_inode_fork_size(ip, whichfork)); in xfs_iroot_realloc()
460 xfs_bmbt_block_len(ip->i_mount)); in xfs_iroot_realloc()
490 xfs_inode_fork_size(ip, whichfork)); in xfs_iroot_realloc()
512 struct xfs_inode *ip, in xfs_idata_realloc() argument
516 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_idata_realloc()
520 ASSERT(new_size <= xfs_inode_fork_size(ip, whichfork)); in xfs_idata_realloc()
567 struct xfs_inode *ip, in xfs_iextents_copy() argument
572 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iextents_copy()
577 xfs_assert_ilocked(ip, XFS_ILOCK_EXCL | XFS_ILOCK_SHARED); in xfs_iextents_copy()
583 ASSERT(xfs_bmap_validate_extent(ip, whichfork, &rec) == NULL); in xfs_iextents_copy()
585 trace_xfs_write_extent(ip, &icur, state, _RET_IP_); in xfs_iextents_copy()
607 struct xfs_inode *ip, in xfs_iflush_fork() argument
624 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iflush_fork()
634 mp = ip->i_mount; in xfs_iflush_fork()
640 ASSERT(ifp->if_bytes <= xfs_inode_fork_size(ip, whichfork)); in xfs_iflush_fork()
649 (void)xfs_iextents_copy(ip, (xfs_bmbt_rec_t *)cp, in xfs_iflush_fork()
659 xfs_inode_fork_size(ip, whichfork)); in xfs_iflush_fork()
670 linux_to_xfs_dev_t(VFS_I(ip)->i_rdev)); in xfs_iflush_fork()
683 struct xfs_inode *ip, in xfs_iext_state_to_fork() argument
687 return ip->i_cowfp; in xfs_iext_state_to_fork()
689 return &ip->i_af; in xfs_iext_state_to_fork()
690 return &ip->i_df; in xfs_iext_state_to_fork()
698 struct xfs_inode *ip) in xfs_ifork_init_cow() argument
700 if (ip->i_cowfp) in xfs_ifork_init_cow()
703 ip->i_cowfp = kmem_cache_zalloc(xfs_ifork_cache, in xfs_ifork_init_cow()
705 ip->i_cowfp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_ifork_init_cow()
711 struct xfs_inode *ip) in xfs_ifork_verify_local_data() argument
715 switch (VFS_I(ip)->i_mode & S_IFMT) { in xfs_ifork_verify_local_data()
717 struct xfs_mount *mp = ip->i_mount; in xfs_ifork_verify_local_data()
718 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_ifork_verify_local_data()
725 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_ifork_verify_local_data()
735 xfs_inode_verifier_error(ip, -EFSCORRUPTED, "data fork", in xfs_ifork_verify_local_data()
736 ip->i_df.if_data, ip->i_df.if_bytes, fa); in xfs_ifork_verify_local_data()
746 struct xfs_inode *ip) in xfs_ifork_verify_local_attr() argument
748 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr()
751 if (!xfs_inode_has_attr_fork(ip)) { in xfs_ifork_verify_local_attr()
754 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr()
760 xfs_inode_verifier_error(ip, -EFSCORRUPTED, "attr fork", in xfs_ifork_verify_local_attr()
778 struct xfs_inode *ip, in xfs_iext_count_extend() argument
782 struct xfs_mount *mp = ip->i_mount; in xfs_iext_count_extend()
784 xfs_inode_has_large_extent_counts(ip); in xfs_iext_count_extend()
785 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iext_count_extend()
805 ip->i_diflags2 |= XFS_DIFLAG2_NREXT64; in xfs_iext_count_extend()
806 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_iext_count_extend()
814 struct xfs_inode *ip, in xfs_ifork_is_realtime() argument
817 return XFS_IS_REALTIME_INODE(ip) && whichfork != XFS_ATTR_FORK; in xfs_ifork_is_realtime()