fork: Use helper function mapping_allow_writable() in dup_mmap()
Subsystems (3)
PATCH 1/1 fork: Use helper function mapping_allow_writable() in dup_mmap()
Use helper function mapping_allow_writable() to atomic_inc i_mmap_writable.
Signed-off-by Miaohe Lin <[email protected]>
--- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/fork.c +1 -1
@@ -558,7 +558,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,atomic_dec (&inode->i_writecount);i_mmap_lock_write (mapping);if (tmp->vm_flags &VM_SHARED ) -atomic_inc (&mapping->i_mmap_writable); +mapping_allow_writable (mapping);flush_dcache_mmap_lock (mapping);/* insert tmp into the share list, just after mpnt */ vma_interval_tree_insert_after(tmp, mpnt,
Signature · 1 line
2.19.1
Quoted 2 lines · Miaohe Lin
Use helper function
mapping_allow_writable()toatomic_inci_mmap_writable.
Why?
Quoted 18 lines
Signed-off-by Miaohe Lin <[email protected]>--- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/fork.c +1
-1@@ -558,7 +558,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,atomic_dec (&inode->i_writecount);i_mmap_lock_write (mapping);if (tmp->vm_flags &VM_SHARED ) -atomic_inc (&mapping->i_mmap_writable); +mapping_allow_writable (mapping);flush_dcache_mmap_lock (mapping);/* insert tmp into the share list, just after mpnt */ vma_interval_tree_insert_after(tmp, mpnt,
Quoted 4 lines · Miaohe Lin
Use helper function
mapping_allow_writable()toatomic_inci_mmap_writable.Signed-off-by Miaohe Lin <[email protected]>---
Hey Miaohe,
Thanks for the patch!
Per se there's nothing against using a proper helper when it exists. But it has already been pointed out that this needs a proper commit message with more rationale. But I'm otherwise happy to take this.
Thanks!
Christian