read = ret;
if (should_fault_in_pages(ret, to, &prev_count, &window_size)) {
- size_t leftover;
-
gfs2_holder_allow_demote(gh);
- leftover = fault_in_iov_iter_writeable(to, window_size);
+ window_size -= fault_in_iov_iter_writeable(to, window_size);
gfs2_holder_disallow_demote(gh);
- if (leftover != window_size) {
+ if (window_size) {
if (gfs2_holder_queued(gh))
goto retry_under_glock;
goto retry;
written = ret;
if (should_fault_in_pages(ret, from, &prev_count, &window_size)) {
- size_t leftover;
-
gfs2_holder_allow_demote(gh);
- leftover = fault_in_iov_iter_readable(from, window_size);
+ window_size -= fault_in_iov_iter_readable(from, window_size);
gfs2_holder_disallow_demote(gh);
- if (leftover != window_size) {
+ if (window_size) {
if (gfs2_holder_queued(gh))
goto retry_under_glock;
goto retry;
read += ret;
if (should_fault_in_pages(ret, to, &prev_count, &window_size)) {
- size_t leftover;
-
gfs2_holder_allow_demote(&gh);
- leftover = fault_in_iov_iter_writeable(to, window_size);
+ window_size -= fault_in_iov_iter_writeable(to, window_size);
gfs2_holder_disallow_demote(&gh);
- if (leftover != window_size) {
+ if (window_size) {
if (gfs2_holder_queued(&gh))
goto retry_under_glock;
goto retry;
from->count = orig_count - written;
if (should_fault_in_pages(ret, from, &prev_count, &window_size)) {
- size_t leftover;
-
gfs2_holder_allow_demote(gh);
- leftover = fault_in_iov_iter_readable(from, window_size);
+ window_size -= fault_in_iov_iter_readable(from, window_size);
gfs2_holder_disallow_demote(gh);
- if (leftover != window_size) {
- from->count = min(from->count, window_size - leftover);
+ if (window_size) {
+ from->count = min(from->count, window_size);
if (gfs2_holder_queued(gh))
goto retry_under_glock;
goto retry;