Use loff_t for file offsets and pgoff_t for page index values
instead of unsigned long, so that it is possible to distinguish
what type of value is being used in the byte-granular readahead
code. Otherwise, it is difficult to determine what units "start"
or "end" in a given function are in.
Rename variables that reference page index values with an "_idx"
suffix to make this clear when reading the code. Similarly, use
"bytes" or "pages" for variable names instead of "count" or "len".
Fix stride_page_count() to properly use loff_t for the byte_count,
which might otherwise overflow for large strides.
Cast pgoff_t vars to loff_t before PAGE_SIZE shift to avoid overflow.
Use shift and mask with PAGE_SIZE and PAGE_MASK instead of mod/div.
Use proper 64-bit division functions for the loff_t types when
calculating stride, since they are not guaranteed to be within 4GB.
Remove unused "remainder" argument from ras_align() function.
Fixes:
91d264551508 ("LU-12518 llite: support page unaligned stride readahead")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie1e18e0766bde2a72311e25536dbb562ce3ebbe5
Reviewed-on: https://review.whamcloud.com/37248
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>