Commit c53473be authored by Dave Chinner's avatar Dave Chinner
Browse files

Merge branch 'xfs-rt-fixes-4.6' into for-next

parents 9deed095 bf85e099
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -495,6 +495,8 @@ enum xfs_blft {
	XFS_BLFT_ATTR_LEAF_BUF,
	XFS_BLFT_ATTR_LEAF_BUF,
	XFS_BLFT_ATTR_RMT_BUF,
	XFS_BLFT_ATTR_RMT_BUF,
	XFS_BLFT_SB_BUF,
	XFS_BLFT_SB_BUF,
	XFS_BLFT_RTBITMAP_BUF,
	XFS_BLFT_RTSUMMARY_BUF,
	XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
	XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
};
};


+29 −1
Original line number Original line Diff line number Diff line
@@ -41,6 +41,31 @@
 * Realtime allocator bitmap functions shared with userspace.
 * Realtime allocator bitmap functions shared with userspace.
 */
 */


/*
 * Real time buffers need verifiers to avoid runtime warnings during IO.
 * We don't have anything to verify, however, so these are just dummy
 * operations.
 */
static void
xfs_rtbuf_verify_read(
	struct xfs_buf	*bp)
{
	return;
}

static void
xfs_rtbuf_verify_write(
	struct xfs_buf	*bp)
{
	return;
}

const struct xfs_buf_ops xfs_rtbuf_ops = {
	.name = "rtbuf",
	.verify_read = xfs_rtbuf_verify_read,
	.verify_write = xfs_rtbuf_verify_write,
};

/*
/*
 * Get a buffer for the bitmap or summary file block specified.
 * Get a buffer for the bitmap or summary file block specified.
 * The buffer is returned read and locked.
 * The buffer is returned read and locked.
@@ -68,9 +93,12 @@ xfs_rtbuf_get(
	ASSERT(map.br_startblock != NULLFSBLOCK);
	ASSERT(map.br_startblock != NULLFSBLOCK);
	error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
	error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
				   XFS_FSB_TO_DADDR(mp, map.br_startblock),
				   XFS_FSB_TO_DADDR(mp, map.br_startblock),
				   mp->m_bsize, 0, &bp, NULL);
				   mp->m_bsize, 0, &bp, &xfs_rtbuf_ops);
	if (error)
	if (error)
		return error;
		return error;

	xfs_trans_buf_set_type(tp, bp, issum ? XFS_BLFT_RTSUMMARY_BUF
					     : XFS_BLFT_RTBITMAP_BUF);
	*bpp = bp;
	*bpp = bp;
	return 0;
	return 0;
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -53,6 +53,7 @@ extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops;
extern const struct xfs_buf_ops xfs_sb_buf_ops;
extern const struct xfs_buf_ops xfs_sb_buf_ops;
extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops;
extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops;
extern const struct xfs_buf_ops xfs_symlink_buf_ops;
extern const struct xfs_buf_ops xfs_symlink_buf_ops;
extern const struct xfs_buf_ops xfs_rtbuf_ops;


/*
/*
 * Transaction types.  Used to distinguish types of buffers. These never reach
 * Transaction types.  Used to distinguish types of buffers. These never reach
+3 −1
Original line number Original line Diff line number Diff line
@@ -202,10 +202,12 @@ xfs_bmap_rtalloc(
		ralen = MAXEXTLEN / mp->m_sb.sb_rextsize;
		ralen = MAXEXTLEN / mp->m_sb.sb_rextsize;


	/*
	/*
	 * Lock out other modifications to the RT bitmap inode.
	 * Lock out modifications to both the RT bitmap and summary inodes
	 */
	 */
	xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL);
	xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL);
	xfs_trans_ijoin(ap->tp, mp->m_rbmip, XFS_ILOCK_EXCL);
	xfs_trans_ijoin(ap->tp, mp->m_rbmip, XFS_ILOCK_EXCL);
	xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL);
	xfs_trans_ijoin(ap->tp, mp->m_rsumip, XFS_ILOCK_EXCL);


	/*
	/*
	 * If it's an allocation to an empty file at offset 0,
	 * If it's an allocation to an empty file at offset 0,
+7 −0
Original line number Original line Diff line number Diff line
@@ -2538,6 +2538,13 @@ xlog_recover_validate_buf_type(
		}
		}
		bp->b_ops = &xfs_sb_buf_ops;
		bp->b_ops = &xfs_sb_buf_ops;
		break;
		break;
#ifdef CONFIG_XFS_RT
	case XFS_BLFT_RTBITMAP_BUF:
	case XFS_BLFT_RTSUMMARY_BUF:
		/* no magic numbers for verification of RT buffers */
		bp->b_ops = &xfs_rtbuf_ops;
		break;
#endif /* CONFIG_XFS_RT */
	default:
	default:
		xfs_warn(mp, "Unknown buffer type %d!",
		xfs_warn(mp, "Unknown buffer type %d!",
			 xfs_blft_from_flags(buf_f));
			 xfs_blft_from_flags(buf_f));