@@ -846,12 +846,10 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to,
846
846
read = ret ;
847
847
848
848
if (should_fault_in_pages (ret , to , & prev_count , & window_size )) {
849
- size_t leftover ;
850
-
851
849
gfs2_holder_allow_demote (gh );
852
- leftover = fault_in_iov_iter_writeable (to , window_size );
850
+ window_size - = fault_in_iov_iter_writeable (to , window_size );
853
851
gfs2_holder_disallow_demote (gh );
854
- if (leftover != window_size ) {
852
+ if (window_size ) {
855
853
if (gfs2_holder_queued (gh ))
856
854
goto retry_under_glock ;
857
855
goto retry ;
@@ -915,12 +913,10 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from,
915
913
written = ret ;
916
914
917
915
if (should_fault_in_pages (ret , from , & prev_count , & window_size )) {
918
- size_t leftover ;
919
-
920
916
gfs2_holder_allow_demote (gh );
921
- leftover = fault_in_iov_iter_readable (from , window_size );
917
+ window_size - = fault_in_iov_iter_readable (from , window_size );
922
918
gfs2_holder_disallow_demote (gh );
923
- if (leftover != window_size ) {
919
+ if (window_size ) {
924
920
if (gfs2_holder_queued (gh ))
925
921
goto retry_under_glock ;
926
922
goto retry ;
@@ -983,12 +979,10 @@ static ssize_t gfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
983
979
read += ret ;
984
980
985
981
if (should_fault_in_pages (ret , to , & prev_count , & window_size )) {
986
- size_t leftover ;
987
-
988
982
gfs2_holder_allow_demote (& gh );
989
- leftover = fault_in_iov_iter_writeable (to , window_size );
983
+ window_size - = fault_in_iov_iter_writeable (to , window_size );
990
984
gfs2_holder_disallow_demote (& gh );
991
- if (leftover != window_size ) {
985
+ if (window_size ) {
992
986
if (gfs2_holder_queued (& gh ))
993
987
goto retry_under_glock ;
994
988
goto retry ;
@@ -1058,13 +1052,11 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
1058
1052
1059
1053
from -> count = orig_count - written ;
1060
1054
if (should_fault_in_pages (ret , from , & prev_count , & window_size )) {
1061
- size_t leftover ;
1062
-
1063
1055
gfs2_holder_allow_demote (gh );
1064
- leftover = fault_in_iov_iter_readable (from , window_size );
1056
+ window_size - = fault_in_iov_iter_readable (from , window_size );
1065
1057
gfs2_holder_disallow_demote (gh );
1066
- if (leftover != window_size ) {
1067
- from -> count = min (from -> count , window_size - leftover );
1058
+ if (window_size ) {
1059
+ from -> count = min (from -> count , window_size );
1068
1060
if (gfs2_holder_queued (gh ))
1069
1061
goto retry_under_glock ;
1070
1062
goto retry ;
0 commit comments