/* This function forces all errors to -EIO for consistency with its predecessor, ocfs2_bread(). We haven't audited what returning the real error codes would do to callers. We log the real codes with mlog_errno() before we squash them.  */
static int ocfs2_read_dir_block(struct inode *inode, u64 v_block, struct buffer_head **bh, int flags)
/* This function forces all errors to -EIO for consistency with its predecessor, ocfs2_bread(). We haven't audited what returning the real error codes would do to callers. We log the real codes with mlog_errno() before we squash them.  */
static int ocfs2_read_dir_block(struct inode *inode, u64 v_block, struct buffer_head **bh, int flags)
{
	int rc = 0;
	struct buffer_head *tmp = *bh;
	rc = ocfs2_read_virt_blocks(inode, v_block, 1, &tmp, flags,
				    ocfs2_validate_dir_block);
	if (rc) {
		mlog_errno(rc);
		goto out;
	}
	if (!(flags & OCFS2_BH_READAHEAD) &&
	    ocfs2_supports_dir_trailer(inode)) {
		rc = ocfs2_check_dir_trailer(inode, tmp);
		if (rc) {
			if (!*bh)
				brelse(tmp);
			mlog_errno(rc);
			goto out;
		}
	}
	if (!*bh)
		*bh = tmp;
out:
	return rc ? -EIO : 0;
}