• Andrew Morton's avatar
    [PATCH] mmap cleanup and lock ranking fixes · bf53ceda
    Andrew Morton authored
    Patch by Christoph Hellwig.
    
    This patch is cleanup of mmap.c with the side-effect of making the lock
    order of mapping->i_shared_lock and mm->page_table_lock consistant.
    
    __remove_shared_vm_struct is merged into its only caller,
    remove_shared_vm_struct, which now also does the job of
    {lock,unlock}_vma_mappings itself, to avoid duplicate checks.
    
    Similarly, vma_link is updated to take and release i_shared_lock
    itself, fixing the lock order.  split_vma is updated to use
    insert_vm_struct instead of using __insert_vm_struct and taking
    page_table_lock and i_shared_lock itself (wrongly).  __insert_vm_struct
    is removed as it is unused now.
    bf53ceda
mmap.c 32.8 KB