#include <linux/pagemap.h>
/* current_is_kswapd() */
#include <linux/swap.h>
+#include <linux/task_io_accounting_ops.h>
#define DEBUG_SUBSYSTEM S_LLITE
PFID(ll_inode2fid(inode)), rc2, vvp_index(vpg));
}
- if (queue->c2_qin.pl_nr > 0)
+ if (queue->c2_qin.pl_nr > 0) {
+ int count = queue->c2_qin.pl_nr;
rc = cl_io_submit_rw(env, io, CRT_READ, queue);
+ if (rc == 0)
+ task_io_account_read(PAGE_SIZE * count);
+ }
if (anchor != NULL && !cl_page_is_owned(page, io)) { /* have sent */
rc = cl_sync_io_wait(env, anchor, 0);
}
run_test 314 "OSP shouldn't fail after last_rcvd update failure"
+test_315() { # LU-618
+ local file=$DIR/$tfile
+ rm -f $file
+
+ $MULTIOP $file oO_CREAT:O_DIRECT:O_RDWR:w4096000c
+ $MULTIOP $file oO_RDONLY:r4096000_c &
+ PID=$!
+
+ sleep 2
+
+ local rbytes=$(awk '/read_bytes/ { print $2 }' /proc/$PID/io)
+ kill -USR1 $PID
+
+ [ $rbytes -gt 4000000 ] || error "read is not accounted ($rbytes)"
+ rm -f $file
+}
+run_test 315 "read should be accounted"
+
test_fake_rw() {
local read_write=$1
if [ "$read_write" = "write" ]; then