+ int throttle_type;
+
+ if ( (throttle_type = cluster_hard_throttle_on(vp, 1)) ) {
+ /*
+ * we're in the throttle window, at the very least
+ * we want to limit the size of the I/O we're about
+ * to issue
+ */
+ if ( (flags & IO_RETURN_ON_THROTTLE) && throttle_type == 2) {
+ /*
+ * we're in the throttle window and at least 1 I/O
+ * has already been issued by a throttleable thread
+ * in this window, so return with EAGAIN to indicate
+ * to the FS issuing the cluster_write call that it
+ * should now throttle after dropping any locks
+ */
+ throttle_info_update_by_mount(vp->v_mount);
+
+ io_throttled = TRUE;
+ goto wait_for_dwrites;
+ }
+ max_vector_size = THROTTLE_MAX_IOSIZE;
+ max_io_size = THROTTLE_MAX_IOSIZE;
+ } else {
+ max_vector_size = MAX_VECTOR_UPL_SIZE;
+ max_io_size = max_upl_size;
+ }