diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 9322e13f0c63..51fc429527bc 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -83,7 +83,9 @@ xfs_readlink_bmap( | |||
83 | 83 | ||
84 | bp = xfs_buf_read(mp->m_ddev_targp, d, BTOBB(byte_cnt), | 84 | bp = xfs_buf_read(mp->m_ddev_targp, d, BTOBB(byte_cnt), |
85 | XBF_LOCK | XBF_MAPPED | XBF_DONT_BLOCK); | 85 | XBF_LOCK | XBF_MAPPED | XBF_DONT_BLOCK); |
86 | error = XFS_BUF_GETERROR(bp); | 86 | if (!bp) |
87 | return XFS_ERROR(ENOMEM); | ||
88 | error = bp->b_error; | ||
87 | if (error) { | 89 | if (error) { |
88 | xfs_ioerror_alert("xfs_readlink", | 90 | xfs_ioerror_alert("xfs_readlink", |
89 | ip->i_mount, bp, XFS_BUF_ADDR(bp)); | 91 | ip->i_mount, bp, XFS_BUF_ADDR(bp)); |
@@ -94,7 +96,7 @@ xfs_readlink_bmap( | |||
94 | byte_cnt = pathlen; | 96 | byte_cnt = pathlen; |
95 | pathlen -= byte_cnt; | 97 | pathlen -= byte_cnt; |
96 | 98 | ||
97 | memcpy(link, XFS_BUF_PTR(bp), byte_cnt); | 99 | memcpy(link, bp->b_addr, byte_cnt); |
98 | xfs_buf_relse(bp); | 100 | xfs_buf_relse(bp); |
99 | } | 101 | } |
100 | 102 | ||
@@ -1648,13 +1650,13 @@ xfs_symlink( | |||
1648 | byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount); | 1650 | byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount); |
1649 | bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, | 1651 | bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, |
1650 | BTOBB(byte_cnt), 0); | 1652 | BTOBB(byte_cnt), 0); |
1651 | ASSERT(bp && !XFS_BUF_GETERROR(bp)); | 1653 | ASSERT(!xfs_buf_geterror(bp)); |
1652 | if (pathlen < byte_cnt) { | 1654 | if (pathlen < byte_cnt) { |
1653 | byte_cnt = pathlen; | 1655 | byte_cnt = pathlen; |
1654 | } | 1656 | } |
1655 | pathlen -= byte_cnt; | 1657 | pathlen -= byte_cnt; |
1656 | 1658 | ||
1657 | memcpy(XFS_BUF_PTR(bp), cur_chunk, byte_cnt); | 1659 | memcpy(bp->b_addr, cur_chunk, byte_cnt); |
1658 | cur_chunk += byte_cnt; | 1660 | cur_chunk += byte_cnt; |
1659 | 1661 | ||
1660 | xfs_trans_log_buf(tp, bp, 0, byte_cnt - 1); | 1662 | xfs_trans_log_buf(tp, bp, 0, byte_cnt - 1); |
@@ -1999,7 +2001,7 @@ xfs_zero_remaining_bytes( | |||
1999 | mp, bp, XFS_BUF_ADDR(bp)); | 2001 | mp, bp, XFS_BUF_ADDR(bp)); |
2000 | break; | 2002 | break; |
2001 | } | 2003 | } |
2002 | memset(XFS_BUF_PTR(bp) + | 2004 | memset(bp->b_addr + |
2003 | (offset - XFS_FSB_TO_B(mp, imap.br_startoff)), | 2005 | (offset - XFS_FSB_TO_B(mp, imap.br_startoff)), |
2004 | 0, lastoffset - offset + 1); | 2006 | 0, lastoffset - offset + 1); |
2005 | XFS_BUF_UNDONE(bp); | 2007 | XFS_BUF_UNDONE(bp); |