mirror of
https://github.com/torvalds/linux.git
synced 2024-12-22 19:01:37 +00:00
device-dax: use ALIGN() for determining pgoff
Rather than calculating @pgoff manually, switch to ALIGN() instead. Link: https://lkml.kernel.org/r/20211202204422.26777-6-joao.m.martins@oracle.com Suggested-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Jane Chu <jane.chu@oracle.com> Cc: Jason Gunthorpe <jgg@nvidia.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Muchun Song <songmuchun@bytedance.com> Cc: Naoya Horiguchi <naoya.horiguchi@nec.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c4386bd8ee
commit
b9b5777f09
@ -234,8 +234,8 @@ static vm_fault_t dev_dax_huge_fault(struct vm_fault *vmf,
|
||||
* mapped. No need to consider the zero page, or racing
|
||||
* conflicting mappings.
|
||||
*/
|
||||
pgoff = linear_page_index(vmf->vma, vmf->address
|
||||
& ~(fault_size - 1));
|
||||
pgoff = linear_page_index(vmf->vma,
|
||||
ALIGN(vmf->address, fault_size));
|
||||
for (i = 0; i < fault_size / PAGE_SIZE; i++) {
|
||||
struct page *page;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user