]> git.neil.brown.name Git - history.git/commitdiff
[XFS] Permit buffered writes to the real-time subvolume.
authorGlen Overby <overby@sgi.com>
Thu, 19 Aug 2004 19:10:48 +0000 (05:10 +1000)
committerNathan Scott <nathans@lips.borg.umn.edu>
Thu, 19 Aug 2004 19:10:48 +0000 (05:10 +1000)
SGI Modid: xfs-linux:xfs-kern:174094a
Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/xfs_bmap.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_trans.c

index d797f406e9f122e67257f04fee2f37fb17faf942..70b7a0265d9398290b845ba1053da6d17a485901 100644 (file)
@@ -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;
index 7e1c1290a515bdbfcb0c3c8490a1153b8385170a..536556b5686f405e01ffc42e4741af3dc3540a9d 100644 (file)
@@ -621,7 +621,8 @@ write_map:
         * 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 @@ write_map:
         * 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 @@ write_map:
                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 |
index 8188577391818250e8f7d1239cc424b9edd33da2..c2bbc9a2c8b8faa0714a7b1177334606e7cfbf2b 100644 (file)
@@ -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;