Lines Matching refs:ip
66 struct xfs_inode *ip) in xfs_ilock_data_map_shared() argument
70 if (xfs_need_iread_extents(&ip->i_df)) in xfs_ilock_data_map_shared()
72 xfs_ilock(ip, lock_mode); in xfs_ilock_data_map_shared()
78 struct xfs_inode *ip) in xfs_ilock_attr_map_shared() argument
82 if (xfs_inode_has_attr_fork(ip) && xfs_need_iread_extents(&ip->i_af)) in xfs_ilock_attr_map_shared()
84 xfs_ilock(ip, lock_mode); in xfs_ilock_attr_map_shared()
140 xfs_inode_t *ip, in xfs_ilock() argument
143 trace_xfs_ilock(ip, lock_flags, _RET_IP_); in xfs_ilock()
148 down_write_nested(&VFS_I(ip)->i_rwsem, in xfs_ilock()
151 down_read_nested(&VFS_I(ip)->i_rwsem, in xfs_ilock()
156 down_write_nested(&VFS_I(ip)->i_mapping->invalidate_lock, in xfs_ilock()
159 down_read_nested(&VFS_I(ip)->i_mapping->invalidate_lock, in xfs_ilock()
164 down_write_nested(&ip->i_lock, XFS_ILOCK_DEP(lock_flags)); in xfs_ilock()
166 down_read_nested(&ip->i_lock, XFS_ILOCK_DEP(lock_flags)); in xfs_ilock()
183 xfs_inode_t *ip, in xfs_ilock_nowait() argument
186 trace_xfs_ilock_nowait(ip, lock_flags, _RET_IP_); in xfs_ilock_nowait()
191 if (!down_write_trylock(&VFS_I(ip)->i_rwsem)) in xfs_ilock_nowait()
194 if (!down_read_trylock(&VFS_I(ip)->i_rwsem)) in xfs_ilock_nowait()
199 if (!down_write_trylock(&VFS_I(ip)->i_mapping->invalidate_lock)) in xfs_ilock_nowait()
202 if (!down_read_trylock(&VFS_I(ip)->i_mapping->invalidate_lock)) in xfs_ilock_nowait()
207 if (!down_write_trylock(&ip->i_lock)) in xfs_ilock_nowait()
210 if (!down_read_trylock(&ip->i_lock)) in xfs_ilock_nowait()
217 up_write(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_ilock_nowait()
219 up_read(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_ilock_nowait()
222 up_write(&VFS_I(ip)->i_rwsem); in xfs_ilock_nowait()
224 up_read(&VFS_I(ip)->i_rwsem); in xfs_ilock_nowait()
243 xfs_inode_t *ip, in xfs_iunlock() argument
249 up_write(&VFS_I(ip)->i_rwsem); in xfs_iunlock()
251 up_read(&VFS_I(ip)->i_rwsem); in xfs_iunlock()
254 up_write(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_iunlock()
256 up_read(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_iunlock()
259 up_write(&ip->i_lock); in xfs_iunlock()
261 up_read(&ip->i_lock); in xfs_iunlock()
263 trace_xfs_iunlock(ip, lock_flags, _RET_IP_); in xfs_iunlock()
272 xfs_inode_t *ip, in xfs_ilock_demote() argument
280 downgrade_write(&ip->i_lock); in xfs_ilock_demote()
282 downgrade_write(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_ilock_demote()
284 downgrade_write(&VFS_I(ip)->i_rwsem); in xfs_ilock_demote()
286 trace_xfs_ilock_demote(ip, lock_flags, _RET_IP_); in xfs_ilock_demote()
291 struct xfs_inode *ip, in xfs_assert_ilocked() argument
299 rwsem_assert_held(&ip->i_lock); in xfs_assert_ilocked()
301 rwsem_assert_held_write_nolockdep(&ip->i_lock); in xfs_assert_ilocked()
304 rwsem_assert_held(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_assert_ilocked()
306 rwsem_assert_held_write(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_assert_ilocked()
309 rwsem_assert_held(&VFS_I(ip)->i_rwsem); in xfs_assert_ilocked()
311 rwsem_assert_held_write(&VFS_I(ip)->i_rwsem); in xfs_assert_ilocked()
581 struct xfs_inode *ip = NULL; in xfs_icreate() local
588 error = xfs_iget(mp, tp, ino, XFS_IGET_CREATE, XFS_ILOCK_EXCL, &ip); in xfs_icreate()
592 ASSERT(ip != NULL); in xfs_icreate()
593 xfs_trans_ijoin(tp, ip, 0); in xfs_icreate()
594 xfs_inode_init(tp, args, ip); in xfs_icreate()
597 xfs_setup_inode(ip); in xfs_icreate()
599 *ipp = ip; in xfs_icreate()
709 error = xfs_icreate(tp, ino, args, &du.ip); in xfs_create()
739 xfs_qm_vop_create_dqattach(tp, du.ip, udqp, gdqp, pdqp); in xfs_create()
749 *ipp = du.ip; in xfs_create()
750 xfs_iunlock(du.ip, XFS_ILOCK_EXCL); in xfs_create()
763 if (du.ip) { in xfs_create()
764 xfs_iunlock(du.ip, XFS_ILOCK_EXCL); in xfs_create()
765 xfs_finish_inode_setup(du.ip); in xfs_create()
766 xfs_irele(du.ip); in xfs_create()
787 struct xfs_inode *ip = NULL; in xfs_create_tmpfile() local
817 error = xfs_icreate(tp, ino, args, &ip); in xfs_create_tmpfile()
829 xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); in xfs_create_tmpfile()
831 error = xfs_iunlink(tp, ip); in xfs_create_tmpfile()
843 *ipp = ip; in xfs_create_tmpfile()
844 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_create_tmpfile()
855 if (ip) { in xfs_create_tmpfile()
856 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_create_tmpfile()
857 xfs_finish_inode_setup(ip); in xfs_create_tmpfile()
858 xfs_irele(ip); in xfs_create_tmpfile()
877 .ip = sip, in xfs_link()
976 struct xfs_inode *ip) in xfs_itruncate_clear_reflink_flags() argument
981 if (!xfs_is_reflink_inode(ip)) in xfs_itruncate_clear_reflink_flags()
983 dfork = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_itruncate_clear_reflink_flags()
984 cfork = xfs_ifork_ptr(ip, XFS_COW_FORK); in xfs_itruncate_clear_reflink_flags()
986 ip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK; in xfs_itruncate_clear_reflink_flags()
988 xfs_inode_clear_cowblocks_tag(ip); in xfs_itruncate_clear_reflink_flags()
1015 struct xfs_inode *ip, in xfs_itruncate_extents_flags() argument
1020 struct xfs_mount *mp = ip->i_mount; in xfs_itruncate_extents_flags()
1025 xfs_assert_ilocked(ip, XFS_ILOCK_EXCL); in xfs_itruncate_extents_flags()
1026 if (atomic_read(&VFS_I(ip)->i_count)) in xfs_itruncate_extents_flags()
1027 xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL); in xfs_itruncate_extents_flags()
1028 ASSERT(new_size <= XFS_ISIZE(ip)); in xfs_itruncate_extents_flags()
1030 ASSERT(ip->i_itemp != NULL); in xfs_itruncate_extents_flags()
1031 ASSERT(ip->i_itemp->ili_lock_flags == 0); in xfs_itruncate_extents_flags()
1032 ASSERT(!XFS_NOT_DQATTACHED(mp, ip)); in xfs_itruncate_extents_flags()
1034 trace_xfs_itruncate_extents_start(ip, new_size); in xfs_itruncate_extents_flags()
1054 error = xfs_bunmapi_range(&tp, ip, flags, first_unmap_block, in xfs_itruncate_extents_flags()
1061 error = xfs_reflink_cancel_cow_blocks(ip, &tp, in xfs_itruncate_extents_flags()
1066 xfs_itruncate_clear_reflink_flags(ip); in xfs_itruncate_extents_flags()
1073 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_itruncate_extents_flags()
1075 trace_xfs_itruncate_extents_end(ip, new_size); in xfs_itruncate_extents_flags()
1134 struct xfs_inode *ip) in xfs_inactive_truncate() argument
1136 struct xfs_mount *mp = ip->i_mount; in xfs_inactive_truncate()
1145 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_inactive_truncate()
1146 xfs_trans_ijoin(tp, ip, 0); in xfs_inactive_truncate()
1153 ip->i_disk_size = 0; in xfs_inactive_truncate()
1154 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_inactive_truncate()
1156 error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, 0); in xfs_inactive_truncate()
1160 ASSERT(ip->i_df.if_nextents == 0); in xfs_inactive_truncate()
1166 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_inactive_truncate()
1172 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_inactive_truncate()
1183 struct xfs_inode *ip) in xfs_inactive_ifree() argument
1185 struct xfs_mount *mp = ip->i_mount; in xfs_inactive_ifree()
1238 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_inactive_ifree()
1239 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); in xfs_inactive_ifree()
1241 error = xfs_ifree(tp, ip); in xfs_inactive_ifree()
1242 xfs_assert_ilocked(ip, XFS_ILOCK_EXCL); in xfs_inactive_ifree()
1261 xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_ICOUNT, -1); in xfs_inactive_ifree()
1274 struct xfs_inode *ip) in xfs_inode_needs_inactive() argument
1276 struct xfs_mount *mp = ip->i_mount; in xfs_inode_needs_inactive()
1277 struct xfs_ifork *cow_ifp = xfs_ifork_ptr(ip, XFS_COW_FORK); in xfs_inode_needs_inactive()
1283 if (VFS_I(ip)->i_mode == 0) in xfs_inode_needs_inactive()
1298 if (xfs_is_metadata_inode(ip)) in xfs_inode_needs_inactive()
1306 if (VFS_I(ip)->i_nlink == 0) in xfs_inode_needs_inactive()
1317 return xfs_can_free_eofblocks(ip); in xfs_inode_needs_inactive()
1326 struct xfs_inode *ip) in xfs_inactive_health() argument
1328 struct xfs_mount *mp = ip->i_mount; in xfs_inactive_health()
1333 xfs_inode_measure_sickness(ip, &sick, &checked); in xfs_inactive_health()
1337 trace_xfs_inode_unfixed_corruption(ip, sick); in xfs_inactive_health()
1342 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_inactive_health()
1363 xfs_inode_t *ip) in xfs_inactive() argument
1373 if (VFS_I(ip)->i_mode == 0) { in xfs_inactive()
1374 ASSERT(ip->i_df.if_broot_bytes == 0); in xfs_inactive()
1378 mp = ip->i_mount; in xfs_inactive()
1379 ASSERT(!xfs_iflags_test(ip, XFS_IRECOVERY)); in xfs_inactive()
1381 xfs_inactive_health(ip); in xfs_inactive()
1391 if (xfs_is_metadata_inode(ip)) in xfs_inactive()
1395 if (xfs_inode_has_cow_data(ip)) in xfs_inactive()
1396 xfs_reflink_cancel_cow_range(ip, 0, NULLFILEOFF, true); in xfs_inactive()
1398 if (VFS_I(ip)->i_nlink != 0) { in xfs_inactive()
1404 if (xfs_can_free_eofblocks(ip)) in xfs_inactive()
1405 error = xfs_free_eofblocks(ip); in xfs_inactive()
1410 if (S_ISREG(VFS_I(ip)->i_mode) && in xfs_inactive()
1411 (ip->i_disk_size != 0 || XFS_ISIZE(ip) != 0 || in xfs_inactive()
1412 xfs_inode_has_filedata(ip))) in xfs_inactive()
1415 if (xfs_iflags_test(ip, XFS_IQUOTAUNCHECKED)) { in xfs_inactive()
1424 xfs_qm_dqdetach(ip); in xfs_inactive()
1426 error = xfs_qm_dqattach(ip); in xfs_inactive()
1431 if (S_ISDIR(VFS_I(ip)->i_mode) && ip->i_df.if_nextents > 0) { in xfs_inactive()
1432 xfs_inactive_dir(ip); in xfs_inactive()
1436 if (S_ISLNK(VFS_I(ip)->i_mode)) in xfs_inactive()
1437 error = xfs_inactive_symlink(ip); in xfs_inactive()
1439 error = xfs_inactive_truncate(ip); in xfs_inactive()
1448 if (xfs_inode_has_attr_fork(ip)) { in xfs_inactive()
1449 error = xfs_attr_inactive(ip); in xfs_inactive()
1454 ASSERT(ip->i_forkoff == 0); in xfs_inactive()
1459 error = xfs_inactive_ifree(ip); in xfs_inactive()
1466 xfs_qm_dqdetach(ip); in xfs_inactive()
1481 struct xfs_inode *ip; in xfs_iunlink_lookup() local
1484 ip = radix_tree_lookup(&pag->pag_ici_root, agino); in xfs_iunlink_lookup()
1485 if (!ip) { in xfs_iunlink_lookup()
1495 if (WARN_ON_ONCE(!ip->i_ino)) { in xfs_iunlink_lookup()
1499 ASSERT(!xfs_iflags_test(ip, XFS_IRECLAIMABLE | XFS_IRECLAIM)); in xfs_iunlink_lookup()
1501 return ip; in xfs_iunlink_lookup()
1578 struct xfs_inode *ip; in xfs_ifree_mark_inode_stale() local
1582 ip = radix_tree_lookup(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, inum)); in xfs_ifree_mark_inode_stale()
1585 if (!ip) { in xfs_ifree_mark_inode_stale()
1596 spin_lock(&ip->i_flags_lock); in xfs_ifree_mark_inode_stale()
1597 if (ip->i_ino != inum || __xfs_iflags_test(ip, XFS_ISTALE)) in xfs_ifree_mark_inode_stale()
1606 if (ip != free_ip) { in xfs_ifree_mark_inode_stale()
1607 if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL)) { in xfs_ifree_mark_inode_stale()
1608 spin_unlock(&ip->i_flags_lock); in xfs_ifree_mark_inode_stale()
1614 ip->i_flags |= XFS_ISTALE; in xfs_ifree_mark_inode_stale()
1621 iip = ip->i_itemp; in xfs_ifree_mark_inode_stale()
1622 if (__xfs_iflags_test(ip, XFS_IFLUSHING)) { in xfs_ifree_mark_inode_stale()
1637 __xfs_iflags_set(ip, XFS_IFLUSHING); in xfs_ifree_mark_inode_stale()
1638 spin_unlock(&ip->i_flags_lock); in xfs_ifree_mark_inode_stale()
1649 if (ip != free_ip) in xfs_ifree_mark_inode_stale()
1650 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_ifree_mark_inode_stale()
1654 if (ip != free_ip) in xfs_ifree_mark_inode_stale()
1655 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_ifree_mark_inode_stale()
1657 spin_unlock(&ip->i_flags_lock); in xfs_ifree_mark_inode_stale()
1767 struct xfs_inode *ip) in xfs_ifree() argument
1769 struct xfs_mount *mp = ip->i_mount; in xfs_ifree()
1772 struct xfs_inode_log_item *iip = ip->i_itemp; in xfs_ifree()
1775 xfs_assert_ilocked(ip, XFS_ILOCK_EXCL); in xfs_ifree()
1776 ASSERT(VFS_I(ip)->i_nlink == 0); in xfs_ifree()
1777 ASSERT(ip->i_df.if_nextents == 0); in xfs_ifree()
1778 ASSERT(ip->i_disk_size == 0 || !S_ISREG(VFS_I(ip)->i_mode)); in xfs_ifree()
1779 ASSERT(ip->i_nblocks == 0); in xfs_ifree()
1781 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_ifree()
1783 error = xfs_inode_uninit(tp, pag, ip, &xic); in xfs_ifree()
1787 if (xfs_iflags_test(ip, XFS_IPRESERVE_DM_FIELDS)) in xfs_ifree()
1788 xfs_iflags_clear(ip, XFS_IPRESERVE_DM_FIELDS); in xfs_ifree()
1796 error = xfs_ifree_cluster(tp, pag, ip, &xic); in xfs_ifree()
1809 struct xfs_inode *ip) in xfs_iunpin() argument
1811 xfs_assert_ilocked(ip, XFS_ILOCK_EXCL | XFS_ILOCK_SHARED); in xfs_iunpin()
1813 trace_xfs_inode_unpin_nowait(ip, _RET_IP_); in xfs_iunpin()
1816 xfs_log_force_seq(ip->i_mount, ip->i_itemp->ili_commit_seq, 0, NULL); in xfs_iunpin()
1822 struct xfs_inode *ip) in __xfs_iunpin_wait() argument
1824 wait_queue_head_t *wq = bit_waitqueue(&ip->i_flags, __XFS_IPINNED_BIT); in __xfs_iunpin_wait()
1825 DEFINE_WAIT_BIT(wait, &ip->i_flags, __XFS_IPINNED_BIT); in __xfs_iunpin_wait()
1827 xfs_iunpin(ip); in __xfs_iunpin_wait()
1831 if (xfs_ipincount(ip)) in __xfs_iunpin_wait()
1833 } while (xfs_ipincount(ip)); in __xfs_iunpin_wait()
1839 struct xfs_inode *ip) in xfs_iunpin_wait() argument
1841 if (xfs_ipincount(ip)) in xfs_iunpin_wait()
1842 __xfs_iunpin_wait(ip); in xfs_iunpin_wait()
1876 struct xfs_inode *ip) in xfs_remove() argument
1881 .ip = ip, in xfs_remove()
1885 int is_dir = S_ISDIR(VFS_I(ip)->i_mode); in xfs_remove()
1901 error = xfs_qm_dqattach(ip); in xfs_remove()
1921 error = xfs_trans_alloc_dir(dp, &M_RES(mp)->tr_remove, ip, &resblks, in xfs_remove()
1944 if (is_dir && xfs_inode_is_filestream(ip)) in xfs_remove()
1945 xfs_filestream_deassociate(ip); in xfs_remove()
1947 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_remove()
1955 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_remove()
2106 .ip = src_ip, in xfs_rename()
2111 .ip = target_ip, in xfs_rename()
2137 &du_wip.ip); in xfs_rename()
2145 xfs_sort_for_rename(src_dp, target_dp, src_ip, target_ip, du_wip.ip, in xfs_rename()
2152 if (du_wip.ip) { in xfs_rename()
2167 target_name->len, du_wip.ip != NULL); in xfs_rename()
2214 if (du_wip.ip) in xfs_rename()
2215 xfs_trans_ijoin(tp, du_wip.ip, 0); in xfs_rename()
2283 if (inodes[i] == du_wip.ip || in xfs_rename()
2303 if (du_wip.ip) { in xfs_rename()
2309 VFS_I(du_wip.ip)->i_state &= ~I_LINKABLE; in xfs_rename()
2335 if (du_wip.ip) in xfs_rename()
2336 xfs_irele(du_wip.ip); in xfs_rename()
2344 struct xfs_inode *ip, in xfs_iflush() argument
2347 struct xfs_inode_log_item *iip = ip->i_itemp; in xfs_iflush()
2349 struct xfs_mount *mp = ip->i_mount; in xfs_iflush()
2352 xfs_assert_ilocked(ip, XFS_ILOCK_EXCL | XFS_ILOCK_SHARED); in xfs_iflush()
2353 ASSERT(xfs_iflags_test(ip, XFS_IFLUSHING)); in xfs_iflush()
2354 ASSERT(ip->i_df.if_format != XFS_DINODE_FMT_BTREE || in xfs_iflush()
2355 ip->i_df.if_nextents > XFS_IFORK_MAXEXT(ip, XFS_DATA_FORK)); in xfs_iflush()
2358 dip = xfs_buf_offset(bp, ip->i_imap.im_boffset); in xfs_iflush()
2371 __func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip); in xfs_iflush()
2374 if (S_ISREG(VFS_I(ip)->i_mode)) { in xfs_iflush()
2376 ip->i_df.if_format != XFS_DINODE_FMT_EXTENTS && in xfs_iflush()
2377 ip->i_df.if_format != XFS_DINODE_FMT_BTREE, in xfs_iflush()
2381 __func__, ip->i_ino, ip); in xfs_iflush()
2384 } else if (S_ISDIR(VFS_I(ip)->i_mode)) { in xfs_iflush()
2386 ip->i_df.if_format != XFS_DINODE_FMT_EXTENTS && in xfs_iflush()
2387 ip->i_df.if_format != XFS_DINODE_FMT_BTREE && in xfs_iflush()
2388 ip->i_df.if_format != XFS_DINODE_FMT_LOCAL, in xfs_iflush()
2392 __func__, ip->i_ino, ip); in xfs_iflush()
2396 if (XFS_TEST_ERROR(ip->i_df.if_nextents + xfs_ifork_nextents(&ip->i_af) > in xfs_iflush()
2397 ip->i_nblocks, mp, XFS_ERRTAG_IFLUSH_5)) { in xfs_iflush()
2401 __func__, ip->i_ino, in xfs_iflush()
2402 ip->i_df.if_nextents + xfs_ifork_nextents(&ip->i_af), in xfs_iflush()
2403 ip->i_nblocks, ip); in xfs_iflush()
2406 if (XFS_TEST_ERROR(ip->i_forkoff > mp->m_sb.sb_inodesize, in xfs_iflush()
2410 __func__, ip->i_ino, ip->i_forkoff, ip); in xfs_iflush()
2423 ip->i_flushiter++; in xfs_iflush()
2429 if (ip->i_df.if_format == XFS_DINODE_FMT_LOCAL && in xfs_iflush()
2430 xfs_ifork_verify_local_data(ip)) in xfs_iflush()
2432 if (xfs_inode_has_attr_fork(ip) && in xfs_iflush()
2433 ip->i_af.if_format == XFS_DINODE_FMT_LOCAL && in xfs_iflush()
2434 xfs_ifork_verify_local_attr(ip)) in xfs_iflush()
2442 xfs_inode_to_disk(ip, dip, iip->ili_item.li_lsn); in xfs_iflush()
2446 if (ip->i_flushiter == DI_MAX_FLUSH) in xfs_iflush()
2447 ip->i_flushiter = 0; in xfs_iflush()
2450 xfs_iflush_fork(ip, dip, iip, XFS_DATA_FORK); in xfs_iflush()
2451 if (xfs_inode_has_attr_fork(ip)) in xfs_iflush()
2452 xfs_iflush_fork(ip, dip, iip, XFS_ATTR_FORK); in xfs_iflush()
2489 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iflush()
2512 struct xfs_inode *ip; in xfs_iflush_cluster() local
2523 ip = iip->ili_inode; in xfs_iflush_cluster()
2528 if (__xfs_iflags_test(ip, XFS_IRECLAIM | XFS_IFLUSHING)) in xfs_iflush_cluster()
2530 if (xfs_ipincount(ip)) in xfs_iflush_cluster()
2540 spin_lock(&ip->i_flags_lock); in xfs_iflush_cluster()
2541 ASSERT(!__xfs_iflags_test(ip, XFS_ISTALE)); in xfs_iflush_cluster()
2542 if (__xfs_iflags_test(ip, XFS_IRECLAIM | XFS_IFLUSHING)) { in xfs_iflush_cluster()
2543 spin_unlock(&ip->i_flags_lock); in xfs_iflush_cluster()
2553 if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) { in xfs_iflush_cluster()
2554 spin_unlock(&ip->i_flags_lock); in xfs_iflush_cluster()
2557 __xfs_iflags_set(ip, XFS_IFLUSHING); in xfs_iflush_cluster()
2558 spin_unlock(&ip->i_flags_lock); in xfs_iflush_cluster()
2568 xfs_iunpin_wait(ip); in xfs_iflush_cluster()
2569 xfs_iflush_abort(ip); in xfs_iflush_cluster()
2570 xfs_iunlock(ip, XFS_ILOCK_SHARED); in xfs_iflush_cluster()
2576 if (xfs_ipincount(ip)) { in xfs_iflush_cluster()
2577 xfs_iflags_clear(ip, XFS_IFLUSHING); in xfs_iflush_cluster()
2578 xfs_iunlock(ip, XFS_ILOCK_SHARED); in xfs_iflush_cluster()
2582 if (!xfs_inode_clean(ip)) in xfs_iflush_cluster()
2583 error = xfs_iflush(ip, bp); in xfs_iflush_cluster()
2585 xfs_iflags_clear(ip, XFS_IFLUSHING); in xfs_iflush_cluster()
2586 xfs_iunlock(ip, XFS_ILOCK_SHARED); in xfs_iflush_cluster()
2621 struct xfs_inode *ip) in xfs_irele() argument
2623 trace_xfs_irele(ip, _RET_IP_); in xfs_irele()
2624 iput(VFS_I(ip)); in xfs_irele()
2632 struct xfs_inode *ip) in xfs_log_force_inode() argument
2636 xfs_ilock(ip, XFS_ILOCK_SHARED); in xfs_log_force_inode()
2637 if (xfs_ipincount(ip)) in xfs_log_force_inode()
2638 seq = ip->i_itemp->ili_commit_seq; in xfs_log_force_inode()
2639 xfs_iunlock(ip, XFS_ILOCK_SHARED); in xfs_log_force_inode()
2643 return xfs_log_force_seq(ip->i_mount, seq, XFS_LOG_SYNC, NULL); in xfs_log_force_inode()
2819 struct xfs_inode *ip) in xfs_inode_reload_unlinked_bucket() argument
2825 xfs_agnumber_t agno = XFS_INO_TO_AGNO(mp, ip->i_ino); in xfs_inode_reload_unlinked_bucket()
2826 xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino); in xfs_inode_reload_unlinked_bucket()
2844 if (!xfs_inode_unlinked_incomplete(ip)) { in xfs_inode_reload_unlinked_bucket()
2852 trace_xfs_inode_reload_unlinked_bucket(ip); in xfs_inode_reload_unlinked_bucket()
2865 next_ip = ip; in xfs_inode_reload_unlinked_bucket()
2907 struct xfs_inode *ip) in xfs_inode_reload_unlinked() argument
2912 error = xfs_trans_alloc_empty(ip->i_mount, &tp); in xfs_inode_reload_unlinked()
2916 xfs_ilock(ip, XFS_ILOCK_SHARED); in xfs_inode_reload_unlinked()
2917 if (xfs_inode_unlinked_incomplete(ip)) in xfs_inode_reload_unlinked()
2918 error = xfs_inode_reload_unlinked_bucket(tp, ip); in xfs_inode_reload_unlinked()
2919 xfs_iunlock(ip, XFS_ILOCK_SHARED); in xfs_inode_reload_unlinked()
2928 const struct xfs_inode *ip, in xfs_ifork_zapped() argument
2935 switch (ip->i_vnode.i_mode & S_IFMT) { in xfs_ifork_zapped()
2943 return ip->i_sick & (XFS_SICK_INO_BMBTD_ZAPPED | datamask); in xfs_ifork_zapped()
2945 return ip->i_sick & XFS_SICK_INO_BMBTA_ZAPPED; in xfs_ifork_zapped()
2955 struct xfs_inode *ip, in xfs_inode_count_blocks() argument
2959 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_inode_count_blocks()
2962 if (XFS_IS_REALTIME_INODE(ip)) in xfs_inode_count_blocks()
2964 *dblocks = ip->i_nblocks - *rblocks; in xfs_inode_count_blocks()
2971 struct xfs_inode *ip = XFS_I(inode); in xfs_wait_dax_page() local
2973 xfs_iunlock(ip, XFS_MMAPLOCK_EXCL); in xfs_wait_dax_page()
2975 xfs_ilock(ip, XFS_MMAPLOCK_EXCL); in xfs_wait_dax_page()
3031 struct xfs_inode *ip) in xfs_inode_alloc_unitsize() argument
3035 if (XFS_IS_REALTIME_INODE(ip)) in xfs_inode_alloc_unitsize()
3036 blocks = ip->i_mount->m_sb.sb_rextsize; in xfs_inode_alloc_unitsize()
3038 return XFS_FSB_TO_B(ip->i_mount, blocks); in xfs_inode_alloc_unitsize()
3044 struct xfs_inode *ip) in xfs_is_always_cow_inode() argument
3046 return ip->i_mount->m_always_cow && xfs_has_reflink(ip->i_mount); in xfs_is_always_cow_inode()