]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/vfs/vfs_cluster.c
xnu-1228.9.59.tar.gz
[apple/xnu.git] / bsd / vfs / vfs_cluster.c
index 3a34e1787f61be54be9aa68585e9f60692a28a70..9b1a7af25f323da25a511614537dc97118da1d31 100644 (file)
@@ -416,6 +416,17 @@ cluster_hard_throttle_on(vnode_t vp)
                if (timevalcmp(&elapsed, &hard_throttle_maxelapsed, <))
                        return(1);
        }
+       struct uthread  *ut;
+       if (throttle_get_io_policy(&ut) == IOPOL_THROTTLE) {
+               size_t devbsdunit;
+               if (vp->v_mount != NULL)
+                       devbsdunit = vp->v_mount->mnt_devbsdunit;
+               else
+                       devbsdunit = LOWPRI_MAX_NUM_DEV - 1;
+               if (throttle_io_will_be_throttled(-1, devbsdunit)) {
+                       return(1);
+               }
+       }
        return(0);
 }