OSDN Git Service

mm/smaps: use vma->vm_pgoff directly when counting partial swap
authorPeter Xu <peterx@redhat.com>
Fri, 5 Nov 2021 20:36:02 +0000 (13:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Nov 2021 20:30:33 +0000 (13:30 -0700)
commit02399c88024f4b7e6c43b3d4aa39c75af0069e17
tree1045b0c021c2cfad34030505ceb2ccc0093281db
parent10c848c8b4805ff026018bfb2b3dedd90e7b0cea
mm/smaps: use vma->vm_pgoff directly when counting partial swap

As it's trying to cover the whole vma anyways, use direct vm_pgoff value
and vma_pages() rather than linear_page_index.

Link: https://lkml.kernel.org/r/20210917164756.8586-3-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c