Commit 047105a9 authored by Glen Overby's avatar Glen Overby Committed by Nathan Scott

[XFS] Permit buffered writes to the real-time subvolume.

SGI Modid: xfs-linux:xfs-kern:174094a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 4d802161
......@@ -4689,8 +4689,41 @@ xfs_bmapi(
}
break;
}
/*
* Split changing sb for alen and indlen since
* they could be coming from different places.
*/
if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
xfs_extlen_t extsz;
xfs_extlen_t ralen;
if (!(extsz = ip->i_d.di_extsize))
extsz = mp->m_sb.sb_rextsize;
ralen = roundup(alen, extsz);
ralen = ralen / mp->m_sb.sb_rextsize;
if (xfs_mod_incore_sb(mp,
XFS_SBS_FREXTENTS,
-(ralen), rsvd)) {
if (XFS_IS_QUOTA_ON(ip->i_mount))
XFS_TRANS_UNRESERVE_BLKQUOTA(
mp, NULL, ip,
(long)alen);
break;
}
} else {
if (xfs_mod_incore_sb(mp,
XFS_SBS_FDBLOCKS,
-(alen), rsvd)) {
if (XFS_IS_QUOTA_ON(ip->i_mount))
XFS_TRANS_UNRESERVE_BLKQUOTA(
mp, NULL, ip,
(long)alen);
break;
}
}
if (xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS,
-(alen + indlen), rsvd)) {
-(indlen), rsvd)) {
XFS_TRANS_UNRESERVE_BLKQUOTA(
mp, NULL, ip, (long)alen);
break;
......
......@@ -621,7 +621,8 @@ xfs_iomap_write_delay(
* request to a stripe width boundary if the file size is >=
* stripe width and we are allocating past the allocation eof.
*/
if (mp->m_swidth && (mp->m_flags & XFS_MOUNT_SWALLOC)
if (!(io->io_flags & XFS_IOCORE_RT) && mp->m_swidth
&& (mp->m_flags & XFS_MOUNT_SWALLOC)
&& (isize >= XFS_FSB_TO_B(mp, mp->m_swidth)) && aeof) {
int eof;
xfs_fileoff_t new_last_fsb;
......@@ -639,8 +640,8 @@ xfs_iomap_write_delay(
* if the file size is >= stripe unit size, and we are allocating past
* the allocation eof.
*/
} else if (mp->m_dalign && (isize >= XFS_FSB_TO_B(mp, mp->m_dalign))
&& aeof) {
} else if (!(io->io_flags & XFS_IOCORE_RT) && mp->m_dalign &&
(isize >= XFS_FSB_TO_B(mp, mp->m_dalign)) && aeof) {
int eof;
xfs_fileoff_t new_last_fsb;
new_last_fsb = roundup_64(last_fsb, mp->m_dalign);
......@@ -651,8 +652,22 @@ xfs_iomap_write_delay(
if (eof) {
last_fsb = new_last_fsb;
}
}
/*
* Round up the allocation request to a real-time extent boundary
* if the file is on the real-time subvolume.
*/
} else if (io->io_flags & XFS_IOCORE_RT && aeof) {
int eof;
xfs_fileoff_t new_last_fsb;
new_last_fsb = roundup_64(last_fsb, mp->m_sb.sb_rextsize);
error = XFS_BMAP_EOF(mp, io, new_last_fsb, XFS_DATA_FORK, &eof);
if (error) {
return error;
}
if (eof)
last_fsb = new_last_fsb;
}
error = xfs_bmapi(NULL, ip, offset_fsb,
(xfs_filblks_t)(last_fsb - offset_fsb),
XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
......
......@@ -491,6 +491,9 @@ xfs_trans_apply_sb_deltas(
if (tp->t_frextents_delta != 0) {
INT_MOD(sbp->sb_frextents, ARCH_CONVERT, tp->t_frextents_delta);
}
if (tp->t_res_frextents_delta != 0) {
INT_MOD(sbp->sb_frextents, ARCH_CONVERT, tp->t_res_frextents_delta);
}
if (tp->t_dblocks_delta != 0) {
INT_MOD(sbp->sb_dblocks, ARCH_CONVERT, tp->t_dblocks_delta);
whole = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment