Skip to content

Commit 7223769

Browse files
weirdsmileyakpm00
authored andcommitted
mm/memory.c: simplify pfnmap_lockdep_assert
Use local `mapping' to reduce the pointer chasing. akpm: extracted from a bugfix which Linus fixed with b1b4675 ("mm: fix follow_pfnmap API lockdep assert"). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Manas <[email protected]> Reviewed-by: Peter Xu <[email protected]> Cc: Anup Sharma <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent ed26552 commit 7223769

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6388,7 +6388,7 @@ static inline void pfnmap_lockdep_assert(struct vm_area_struct *vma)
63886388
struct address_space *mapping = file ? file->f_mapping : NULL;
63896389

63906390
if (mapping)
6391-
lockdep_assert(lockdep_is_held(&vma->vm_file->f_mapping->i_mmap_rwsem) ||
6391+
lockdep_assert(lockdep_is_held(&mapping->i_mmap_rwsem) ||
63926392
lockdep_is_held(&vma->vm_mm->mmap_lock));
63936393
else
63946394
lockdep_assert(lockdep_is_held(&vma->vm_mm->mmap_lock));

0 commit comments

Comments
 (0)