xfs_inode.c (baf44fa5c37a2357a7ae92889f74bc1824f33fd4) xfs_inode.c (0e24ec3c56fbc797b34fc94073320c336336b4f9)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2000-2006 Silicon Graphics, Inc.
4 * All Rights Reserved.
5 */
6#include <linux/iversion.h>
7
8#include "xfs.h"

--- 1725 unchanged lines hidden (view full) ---

1734 * Note: don't bother with iolock here since lockdep complains about
1735 * acquiring it in reclaim context. We have the only reference to the
1736 * inode at this point anyways.
1737 */
1738 return xfs_can_free_eofblocks(ip, true);
1739}
1740
1741/*
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2000-2006 Silicon Graphics, Inc.
4 * All Rights Reserved.
5 */
6#include <linux/iversion.h>
7
8#include "xfs.h"

--- 1725 unchanged lines hidden (view full) ---

1734 * Note: don't bother with iolock here since lockdep complains about
1735 * acquiring it in reclaim context. We have the only reference to the
1736 * inode at this point anyways.
1737 */
1738 return xfs_can_free_eofblocks(ip, true);
1739}
1740
1741/*
1742 * Save health status somewhere, if we're dumping an inode with uncorrected
1743 * errors and online repair isn't running.
1744 */
1745static inline void
1746xfs_inactive_health(
1747 struct xfs_inode *ip)
1748{
1749 struct xfs_mount *mp = ip->i_mount;
1750 struct xfs_perag *pag;
1751 unsigned int sick;
1752 unsigned int checked;
1753
1754 xfs_inode_measure_sickness(ip, &sick, &checked);
1755 if (!sick)
1756 return;
1757
1758 trace_xfs_inode_unfixed_corruption(ip, sick);
1759
1760 if (sick & XFS_SICK_INO_FORGET)
1761 return;
1762
1763 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
1764 if (!pag) {
1765 /* There had better still be a perag structure! */
1766 ASSERT(0);
1767 return;
1768 }
1769
1770 xfs_ag_mark_sick(pag, XFS_SICK_AG_INODES);
1771 xfs_perag_put(pag);
1772}
1773
1774/*
1742 * xfs_inactive
1743 *
1744 * This is called when the vnode reference count for the vnode
1745 * goes to zero. If the file has been unlinked, then it must
1746 * now be truncated. Also, we clear all of the read-ahead state
1747 * kept for the inode here since the file is now closed.
1748 */
1749int

--- 11 unchanged lines hidden (view full) ---

1761 if (VFS_I(ip)->i_mode == 0) {
1762 ASSERT(ip->i_df.if_broot_bytes == 0);
1763 goto out;
1764 }
1765
1766 mp = ip->i_mount;
1767 ASSERT(!xfs_iflags_test(ip, XFS_IRECOVERY));
1768
1775 * xfs_inactive
1776 *
1777 * This is called when the vnode reference count for the vnode
1778 * goes to zero. If the file has been unlinked, then it must
1779 * now be truncated. Also, we clear all of the read-ahead state
1780 * kept for the inode here since the file is now closed.
1781 */
1782int

--- 11 unchanged lines hidden (view full) ---

1794 if (VFS_I(ip)->i_mode == 0) {
1795 ASSERT(ip->i_df.if_broot_bytes == 0);
1796 goto out;
1797 }
1798
1799 mp = ip->i_mount;
1800 ASSERT(!xfs_iflags_test(ip, XFS_IRECOVERY));
1801
1802 xfs_inactive_health(ip);
1803
1769 /*
1770 * If this is a read-only mount, don't do this (would generate I/O)
1771 * unless we're in log recovery and cleaning the iunlinked list.
1772 */
1773 if (xfs_is_readonly(mp) && !xlog_recovery_needed(mp->m_log))
1774 goto out;
1775
1776 /* Metadata inodes require explicit resource cleanup. */

--- 2126 unchanged lines hidden ---
1804 /*
1805 * If this is a read-only mount, don't do this (would generate I/O)
1806 * unless we're in log recovery and cleaning the iunlinked list.
1807 */
1808 if (xfs_is_readonly(mp) && !xlog_recovery_needed(mp->m_log))
1809 goto out;
1810
1811 /* Metadata inodes require explicit resource cleanup. */

--- 2126 unchanged lines hidden ---