]> git.hungrycats.org Git - linux/commitdiff
[XFS] Add support for unsetting realtime flag on realtime file which
authorHerry Wiputra <herry@sgi.com>
Thu, 19 Aug 2004 22:37:07 +0000 (08:37 +1000)
committerNathan Scott <nathans@lips.borg.umn.edu>
Thu, 19 Aug 2004 22:37:07 +0000 (08:37 +1000)
has no extents allocated.

SGI Modid: xfs-linux:xfs-kern:18776a
Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/xfs_vnodeops.c

index d94fb9d9338b6601e3bf0ca55e266613ee46e36c..9e09a2264ab182f084f55e353fbf20d080ac3c15 100644 (file)
@@ -823,10 +823,14 @@ xfs_setattr(
                                mp->m_sb.sb_blocklog;
                }
                if (mask & XFS_AT_XFLAGS) {
-                       ip->i_d.di_flags = 0;
+                       /* can't set PREALLOC this way, just preserve it */
+                       ip->i_d.di_flags =
+                               (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
                        if (vap->va_xflags & XFS_XFLAG_REALTIME) {
                                ip->i_d.di_flags |= XFS_DIFLAG_REALTIME;
                                ip->i_iocore.io_flags |= XFS_IOCORE_RT;
+                       } else {
+                               ip->i_iocore.io_flags &= ~XFS_IOCORE_RT;
                        }
                        if (vap->va_xflags & XFS_XFLAG_IMMUTABLE)
                                ip->i_d.di_flags |= XFS_DIFLAG_IMMUTABLE;
@@ -838,7 +842,6 @@ xfs_setattr(
                                ip->i_d.di_flags |= XFS_DIFLAG_NOATIME;
                        if (vap->va_xflags & XFS_XFLAG_NODUMP)
                                ip->i_d.di_flags |= XFS_DIFLAG_NODUMP;
-                       /* can't set PREALLOC this way, just ignore it */
                }
                xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
                timeflags |= XFS_ICHGTIME_CHG;