aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_ialloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 16fb63a9bc5e..b62771f1f4b5 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -292,7 +292,7 @@ xfs_ialloc_inode_init(
292 mp->m_bsize * blks_per_cluster, 292 mp->m_bsize * blks_per_cluster,
293 XBF_UNMAPPED); 293 XBF_UNMAPPED);
294 if (!fbuf) 294 if (!fbuf)
295 return ENOMEM; 295 return -ENOMEM;
296 296
297 /* Initialize the inode buffers and log them appropriately. */ 297 /* Initialize the inode buffers and log them appropriately. */
298 fbuf->b_ops = &xfs_inode_buf_ops; 298 fbuf->b_ops = &xfs_inode_buf_ops;
@@ -380,7 +380,7 @@ xfs_ialloc_ag_alloc(
380 newlen = args.mp->m_ialloc_inos; 380 newlen = args.mp->m_ialloc_inos;
381 if (args.mp->m_maxicount && 381 if (args.mp->m_maxicount &&
382 args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount) 382 args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount)
383 return ENOSPC; 383 return -ENOSPC;
384 args.minlen = args.maxlen = args.mp->m_ialloc_blks; 384 args.minlen = args.maxlen = args.mp->m_ialloc_blks;
385 /* 385 /*
386 * First try to allocate inodes contiguous with the last-allocated 386 * First try to allocate inodes contiguous with the last-allocated
@@ -1385,7 +1385,7 @@ xfs_dialloc(
1385 if (error) { 1385 if (error) {
1386 xfs_trans_brelse(tp, agbp); 1386 xfs_trans_brelse(tp, agbp);
1387 1387
1388 if (error != ENOSPC) 1388 if (error != -ENOSPC)
1389 goto out_error; 1389 goto out_error;
1390 1390
1391 xfs_perag_put(pag); 1391 xfs_perag_put(pag);
@@ -1416,7 +1416,7 @@ nextag:
1416 agno = 0; 1416 agno = 0;
1417 if (agno == start_agno) { 1417 if (agno == start_agno) {
1418 *inop = NULLFSINO; 1418 *inop = NULLFSINO;
1419 return noroom ? ENOSPC : 0; 1419 return noroom ? -ENOSPC : 0;
1420 } 1420 }
1421 } 1421 }
1422 1422
@@ -1682,7 +1682,7 @@ xfs_difree(
1682 xfs_warn(mp, "%s: agno >= mp->m_sb.sb_agcount (%d >= %d).", 1682 xfs_warn(mp, "%s: agno >= mp->m_sb.sb_agcount (%d >= %d).",
1683 __func__, agno, mp->m_sb.sb_agcount); 1683 __func__, agno, mp->m_sb.sb_agcount);
1684 ASSERT(0); 1684 ASSERT(0);
1685 return EINVAL; 1685 return -EINVAL;
1686 } 1686 }
1687 agino = XFS_INO_TO_AGINO(mp, inode); 1687 agino = XFS_INO_TO_AGINO(mp, inode);
1688 if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) { 1688 if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) {
@@ -1690,14 +1690,14 @@ xfs_difree(
1690 __func__, (unsigned long long)inode, 1690 __func__, (unsigned long long)inode,
1691 (unsigned long long)XFS_AGINO_TO_INO(mp, agno, agino)); 1691 (unsigned long long)XFS_AGINO_TO_INO(mp, agno, agino));
1692 ASSERT(0); 1692 ASSERT(0);
1693 return EINVAL; 1693 return -EINVAL;
1694 } 1694 }
1695 agbno = XFS_AGINO_TO_AGBNO(mp, agino); 1695 agbno = XFS_AGINO_TO_AGBNO(mp, agino);
1696 if (agbno >= mp->m_sb.sb_agblocks) { 1696 if (agbno >= mp->m_sb.sb_agblocks) {
1697 xfs_warn(mp, "%s: agbno >= mp->m_sb.sb_agblocks (%d >= %d).", 1697 xfs_warn(mp, "%s: agbno >= mp->m_sb.sb_agblocks (%d >= %d).",
1698 __func__, agbno, mp->m_sb.sb_agblocks); 1698 __func__, agbno, mp->m_sb.sb_agblocks);
1699 ASSERT(0); 1699 ASSERT(0);
1700 return EINVAL; 1700 return -EINVAL;
1701 } 1701 }
1702 /* 1702 /*
1703 * Get the allocation group header. 1703 * Get the allocation group header.
@@ -1769,7 +1769,7 @@ xfs_imap_lookup(
1769 if (i) 1769 if (i)
1770 error = xfs_inobt_get_rec(cur, &rec, &i); 1770 error = xfs_inobt_get_rec(cur, &rec, &i);
1771 if (!error && i == 0) 1771 if (!error && i == 0)
1772 error = EINVAL; 1772 error = -EINVAL;
1773 } 1773 }
1774 1774
1775 xfs_trans_brelse(tp, agbp); 1775 xfs_trans_brelse(tp, agbp);
@@ -1780,12 +1780,12 @@ xfs_imap_lookup(
1780 /* check that the returned record contains the required inode */ 1780 /* check that the returned record contains the required inode */
1781 if (rec.ir_startino > agino || 1781 if (rec.ir_startino > agino ||
1782 rec.ir_startino + mp->m_ialloc_inos <= agino) 1782 rec.ir_startino + mp->m_ialloc_inos <= agino)
1783 return EINVAL; 1783 return -EINVAL;
1784 1784
1785 /* for untrusted inodes check it is allocated first */ 1785 /* for untrusted inodes check it is allocated first */
1786 if ((flags & XFS_IGET_UNTRUSTED) && 1786 if ((flags & XFS_IGET_UNTRUSTED) &&
1787 (rec.ir_free & XFS_INOBT_MASK(agino - rec.ir_startino))) 1787 (rec.ir_free & XFS_INOBT_MASK(agino - rec.ir_startino)))
1788 return EINVAL; 1788 return -EINVAL;
1789 1789
1790 *chunk_agbno = XFS_AGINO_TO_AGBNO(mp, rec.ir_startino); 1790 *chunk_agbno = XFS_AGINO_TO_AGBNO(mp, rec.ir_startino);
1791 *offset_agbno = agbno - *chunk_agbno; 1791 *offset_agbno = agbno - *chunk_agbno;
@@ -1829,7 +1829,7 @@ xfs_imap(
1829 * as they can be invalid without implying corruption. 1829 * as they can be invalid without implying corruption.
1830 */ 1830 */
1831 if (flags & XFS_IGET_UNTRUSTED) 1831 if (flags & XFS_IGET_UNTRUSTED)
1832 return EINVAL; 1832 return -EINVAL;
1833 if (agno >= mp->m_sb.sb_agcount) { 1833 if (agno >= mp->m_sb.sb_agcount) {
1834 xfs_alert(mp, 1834 xfs_alert(mp,
1835 "%s: agno (%d) >= mp->m_sb.sb_agcount (%d)", 1835 "%s: agno (%d) >= mp->m_sb.sb_agcount (%d)",
@@ -1849,7 +1849,7 @@ xfs_imap(
1849 } 1849 }
1850 xfs_stack_trace(); 1850 xfs_stack_trace();
1851#endif /* DEBUG */ 1851#endif /* DEBUG */
1852 return EINVAL; 1852 return -EINVAL;
1853 } 1853 }
1854 1854
1855 blks_per_cluster = xfs_icluster_size_fsb(mp); 1855 blks_per_cluster = xfs_icluster_size_fsb(mp);
@@ -1922,7 +1922,7 @@ out_map:
1922 __func__, (unsigned long long) imap->im_blkno, 1922 __func__, (unsigned long long) imap->im_blkno,
1923 (unsigned long long) imap->im_len, 1923 (unsigned long long) imap->im_len,
1924 XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)); 1924 XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks));
1925 return EINVAL; 1925 return -EINVAL;
1926 } 1926 }
1927 return 0; 1927 return 0;
1928} 1928}
@@ -2072,11 +2072,11 @@ xfs_agi_read_verify(
2072 2072
2073 if (xfs_sb_version_hascrc(&mp->m_sb) && 2073 if (xfs_sb_version_hascrc(&mp->m_sb) &&
2074 !xfs_buf_verify_cksum(bp, XFS_AGI_CRC_OFF)) 2074 !xfs_buf_verify_cksum(bp, XFS_AGI_CRC_OFF))
2075 xfs_buf_ioerror(bp, EFSBADCRC); 2075 xfs_buf_ioerror(bp, -EFSBADCRC);
2076 else if (XFS_TEST_ERROR(!xfs_agi_verify(bp), mp, 2076 else if (XFS_TEST_ERROR(!xfs_agi_verify(bp), mp,
2077 XFS_ERRTAG_IALLOC_READ_AGI, 2077 XFS_ERRTAG_IALLOC_READ_AGI,
2078 XFS_RANDOM_IALLOC_READ_AGI)) 2078 XFS_RANDOM_IALLOC_READ_AGI))
2079 xfs_buf_ioerror(bp, EFSCORRUPTED); 2079 xfs_buf_ioerror(bp, -EFSCORRUPTED);
2080 2080
2081 if (bp->b_error) 2081 if (bp->b_error)
2082 xfs_verifier_error(bp); 2082 xfs_verifier_error(bp);
@@ -2090,7 +2090,7 @@ xfs_agi_write_verify(
2090 struct xfs_buf_log_item *bip = bp->b_fspriv; 2090 struct xfs_buf_log_item *bip = bp->b_fspriv;
2091 2091
2092 if (!xfs_agi_verify(bp)) { 2092 if (!xfs_agi_verify(bp)) {
2093 xfs_buf_ioerror(bp, EFSCORRUPTED); 2093 xfs_buf_ioerror(bp, -EFSCORRUPTED);
2094 xfs_verifier_error(bp); 2094 xfs_verifier_error(bp);
2095 return; 2095 return;
2096 } 2096 }