aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2013-09-20 11:06:12 -0400
committerBen Myers <bpm@sgi.com>2013-10-08 18:20:41 -0400
commit74564fb48cbfcb5b433c1baec1f3158ea638b203 (patch)
tree8c927f98ca8696c01e7ce8e325f4ebb511afc320 /fs/xfs/xfs_inode.c
parent88877d2b9727a14431bfe48216ff86331ab47ea5 (diff)
xfs: clean up xfs_inactive() error handling, kill VN_INACTIVE_[NO]CACHE
The xfs_inactive() return value is meaningless. Turn xfs_inactive() into a void function and clean up the error handling appropriately. Kill the VN_INACTIVE_[NO]CACHE directives as they are not relevant to Linux. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 223d1a163b2d..5fce7261a64b 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1790,7 +1790,7 @@ xfs_inactive_ifree(
1790 * now be truncated. Also, we clear all of the read-ahead state 1790 * now be truncated. Also, we clear all of the read-ahead state
1791 * kept for the inode here since the file is now closed. 1791 * kept for the inode here since the file is now closed.
1792 */ 1792 */
1793int 1793void
1794xfs_inactive( 1794xfs_inactive(
1795 xfs_inode_t *ip) 1795 xfs_inode_t *ip)
1796{ 1796{
@@ -1805,16 +1805,14 @@ xfs_inactive(
1805 if (ip->i_d.di_mode == 0) { 1805 if (ip->i_d.di_mode == 0) {
1806 ASSERT(ip->i_df.if_real_bytes == 0); 1806 ASSERT(ip->i_df.if_real_bytes == 0);
1807 ASSERT(ip->i_df.if_broot_bytes == 0); 1807 ASSERT(ip->i_df.if_broot_bytes == 0);
1808 return VN_INACTIVE_CACHE; 1808 return;
1809 } 1809 }
1810 1810
1811 mp = ip->i_mount; 1811 mp = ip->i_mount;
1812 1812
1813 error = 0;
1814
1815 /* If this is a read-only mount, don't do this (would generate I/O) */ 1813 /* If this is a read-only mount, don't do this (would generate I/O) */
1816 if (mp->m_flags & XFS_MOUNT_RDONLY) 1814 if (mp->m_flags & XFS_MOUNT_RDONLY)
1817 goto out; 1815 return;
1818 1816
1819 if (ip->i_d.di_nlink != 0) { 1817 if (ip->i_d.di_nlink != 0) {
1820 /* 1818 /*
@@ -1822,12 +1820,10 @@ xfs_inactive(
1822 * cache. Post-eof blocks must be freed, lest we end up with 1820 * cache. Post-eof blocks must be freed, lest we end up with
1823 * broken free space accounting. 1821 * broken free space accounting.
1824 */ 1822 */
1825 if (xfs_can_free_eofblocks(ip, true)) { 1823 if (xfs_can_free_eofblocks(ip, true))
1826 error = xfs_free_eofblocks(mp, ip, false); 1824 xfs_free_eofblocks(mp, ip, false);
1827 if (error) 1825
1828 return VN_INACTIVE_CACHE; 1826 return;
1829 }
1830 goto out;
1831 } 1827 }
1832 1828
1833 if (S_ISREG(ip->i_d.di_mode) && 1829 if (S_ISREG(ip->i_d.di_mode) &&
@@ -1837,14 +1833,14 @@ xfs_inactive(
1837 1833
1838 error = xfs_qm_dqattach(ip, 0); 1834 error = xfs_qm_dqattach(ip, 0);
1839 if (error) 1835 if (error)
1840 return VN_INACTIVE_CACHE; 1836 return;
1841 1837
1842 if (S_ISLNK(ip->i_d.di_mode)) 1838 if (S_ISLNK(ip->i_d.di_mode))
1843 error = xfs_inactive_symlink(ip); 1839 error = xfs_inactive_symlink(ip);
1844 else if (truncate) 1840 else if (truncate)
1845 error = xfs_inactive_truncate(ip); 1841 error = xfs_inactive_truncate(ip);
1846 if (error) 1842 if (error)
1847 goto out; 1843 return;
1848 1844
1849 /* 1845 /*
1850 * If there are attributes associated with the file then blow them away 1846 * If there are attributes associated with the file then blow them away
@@ -1857,7 +1853,7 @@ xfs_inactive(
1857 1853
1858 error = xfs_attr_inactive(ip); 1854 error = xfs_attr_inactive(ip);
1859 if (error) 1855 if (error)
1860 goto out; 1856 return;
1861 } 1857 }
1862 1858
1863 if (ip->i_afp) 1859 if (ip->i_afp)
@@ -1870,14 +1866,12 @@ xfs_inactive(
1870 */ 1866 */
1871 error = xfs_inactive_ifree(ip); 1867 error = xfs_inactive_ifree(ip);
1872 if (error) 1868 if (error)
1873 goto out; 1869 return;
1874 1870
1875 /* 1871 /*
1876 * Release the dquots held by inode, if any. 1872 * Release the dquots held by inode, if any.
1877 */ 1873 */
1878 xfs_qm_dqdetach(ip); 1874 xfs_qm_dqdetach(ip);
1879out:
1880 return VN_INACTIVE_CACHE;
1881} 1875}
1882 1876
1883/* 1877/*