aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2014-10-09 18:28:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-09 22:25:57 -0400
commit81d1b09c6be66afac7d41ee52279d9bccbce56d8 (patch)
tree22bc3aa61748eb31bff7a101a3028f45231561eb /mm/hugetlb.c
parentfa3759ccd5651c4235f572302d58c8ec9ddf1c4b (diff)
mm: convert a few VM_BUG_ON callers to VM_BUG_ON_VMA
Trivially convert a few VM_BUG_ON calls to VM_BUG_ON_VMA to extract more information when they trigger. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Michal Hocko <mhocko@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Michel Lespinasse <walken@google.com> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index eeceeeb09019..9fd722769927 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -434,7 +434,7 @@ static inline struct resv_map *inode_resv_map(struct inode *inode)
434 434
435static struct resv_map *vma_resv_map(struct vm_area_struct *vma) 435static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
436{ 436{
437 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 437 VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
438 if (vma->vm_flags & VM_MAYSHARE) { 438 if (vma->vm_flags & VM_MAYSHARE) {
439 struct address_space *mapping = vma->vm_file->f_mapping; 439 struct address_space *mapping = vma->vm_file->f_mapping;
440 struct inode *inode = mapping->host; 440 struct inode *inode = mapping->host;
@@ -449,8 +449,8 @@ static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
449 449
450static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map) 450static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
451{ 451{
452 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 452 VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
453 VM_BUG_ON(vma->vm_flags & VM_MAYSHARE); 453 VM_BUG_ON_VMA(vma->vm_flags & VM_MAYSHARE, vma);
454 454
455 set_vma_private_data(vma, (get_vma_private_data(vma) & 455 set_vma_private_data(vma, (get_vma_private_data(vma) &
456 HPAGE_RESV_MASK) | (unsigned long)map); 456 HPAGE_RESV_MASK) | (unsigned long)map);
@@ -458,15 +458,15 @@ static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
458 458
459static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags) 459static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags)
460{ 460{
461 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 461 VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
462 VM_BUG_ON(vma->vm_flags & VM_MAYSHARE); 462 VM_BUG_ON_VMA(vma->vm_flags & VM_MAYSHARE, vma);
463 463
464 set_vma_private_data(vma, get_vma_private_data(vma) | flags); 464 set_vma_private_data(vma, get_vma_private_data(vma) | flags);
465} 465}
466 466
467static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag) 467static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag)
468{ 468{
469 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 469 VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
470 470
471 return (get_vma_private_data(vma) & flag) != 0; 471 return (get_vma_private_data(vma) & flag) != 0;
472} 472}
@@ -474,7 +474,7 @@ static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag)
474/* Reset counters to 0 and clear all HPAGE_RESV_* flags */ 474/* Reset counters to 0 and clear all HPAGE_RESV_* flags */
475void reset_vma_resv_huge_pages(struct vm_area_struct *vma) 475void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
476{ 476{
477 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 477 VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
478 if (!(vma->vm_flags & VM_MAYSHARE)) 478 if (!(vma->vm_flags & VM_MAYSHARE))
479 vma->vm_private_data = (void *)0; 479 vma->vm_private_data = (void *)0;
480} 480}