xfs: kill xfs_buf_geterror()
Most of the callers are just calling ASSERT(!xfs_buf_geterror()) which means they are checking for bp->b_error == 0. If bp is null in this case, we will assert fail, and hence it's no different in result to oopsing because of a null bp. In some cases, errors have already been checked for or the function returning the buffer can't return a buffer with an error, so it's just a redundant assert. Either way, the assert can either be removed. The other two non-assert callers can just test for a buffer and error properly. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:

committed by
Dave Chinner

parent
556b8883cf
commit
36de95567f
@@ -353,10 +353,10 @@ xfs_qm_dqalloc(
|
||||
dqp->q_blkno,
|
||||
mp->m_quotainfo->qi_dqchunklen,
|
||||
0);
|
||||
|
||||
error = xfs_buf_geterror(bp);
|
||||
if (error)
|
||||
if (!bp) {
|
||||
error = ENOMEM;
|
||||
goto error1;
|
||||
}
|
||||
bp->b_ops = &xfs_dquot_buf_ops;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user