/* just a sum of the loi/lop pending numbers to be exported by /proc */
atomic_t cl_pending_w_pages;
atomic_t cl_pending_r_pages;
- __u32 cl_max_pages_per_rpc;
- __u32 cl_max_rpcs_in_flight;
- __u32 cl_short_io_bytes;
+ u32 cl_max_pages_per_rpc;
+ u32 cl_max_rpcs_in_flight;
+ u32 cl_max_short_io_bytes;
struct obd_histogram cl_read_rpc_hist;
struct obd_histogram cl_write_rpc_hist;
struct obd_histogram cl_read_page_hist;
* from OFD after connecting. */
cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES;
- cli->cl_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
+ cli->cl_max_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
/* set cl_chunkbits default value to PAGE_SHIFT,
* it will be updated at OSC connection time. */
int rc;
spin_lock(&cli->cl_loi_list_lock);
- rc = sprintf(buf, "%d\n", cli->cl_short_io_bytes);
+ rc = sprintf(buf, "%d\n", cli->cl_max_short_io_bytes);
spin_unlock(&cli->cl_loi_list_lock);
return rc;
}
if (rc)
GOTO(out, rc);
- if (val < MIN_SHORT_IO_BYTES || val > OBD_MAX_SHORT_IO_BYTES)
+ if (val && (val < MIN_SHORT_IO_BYTES || val > OBD_MAX_SHORT_IO_BYTES))
GOTO(out, rc = -ERANGE);
rc = count;
if (val > (cli->cl_max_pages_per_rpc << PAGE_SHIFT))
rc = -ERANGE;
else
- cli->cl_short_io_bytes = val;
+ cli->cl_max_short_io_bytes = val;
spin_unlock(&cli->cl_loi_list_lock);
out:
for (i = 0; i < page_count; i++)
short_io_size += pga[i]->count;
- /* Check if we can do a short io. */
- if (!(short_io_size <= cli->cl_short_io_bytes && niocount == 1 &&
- imp_connect_shortio(cli->cl_import)))
+ /* Check if read/write is small enough to be a short io. */
+ if (short_io_size > cli->cl_max_short_io_bytes || niocount > 1 ||
+ !imp_connect_shortio(cli->cl_import))
short_io_size = 0;
req_capsule_set_size(pill, &RMF_SHORT_IO, RCL_CLIENT,