From: Andreas Dilger Date: Wed, 15 Jan 2020 10:30:32 +0000 (-0700) Subject: LU-12518 llite: proper names/types for offset/pages X-Git-Tag: 2.13.52~63 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=83d8dd1d7c30c41e837b07b97198ad77bd903eea;hp=83d8dd1d7c30c41e837b07b97198ad77bd903eea LU-12518 llite: proper names/types for offset/pages 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 Change-Id: Ie1e18e0766bde2a72311e25536dbb562ce3ebbe5 Reviewed-on: https://review.whamcloud.com/37248 Reviewed-by: Wang Shilong Tested-by: jenkins Reviewed-by: Gu Zheng Tested-by: Maloo Reviewed-by: Oleg Drokin ---