From 68e398065d725cd7dfc653b5e7103a5de4bdf2c7 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Tue, 26 Jul 2011 16:09:03 -0700 Subject: [PATCH] --- yaml --- r: 260443 b: refs/heads/master c: b2588c4b4c3c075e9b45d61065d86c60de2b6441 h: refs/heads/master i: 260441: c6651224a118fb03ecdcf8c84ebbccf92998b9c7 260439: f2361564cdfad59d6daff71d83175cc8f50dbbd8 v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 47 +++++++++++++++---------------------------- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/[refs] b/[refs] index 5bf29c8b6c0c..333bb36d89a4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 810f09b87b75d7cc3906ffffe4311003f37caa2a +refs/heads/master: b2588c4b4c3c075e9b45d61065d86c60de2b6441 diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 72c6820a345c..1dbcf8888f14 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -1370,21 +1370,12 @@ struct page *buffered_rmqueue(struct zone *preferred_zone, #ifdef CONFIG_FAIL_PAGE_ALLOC -static struct fail_page_alloc_attr { +static struct { struct fault_attr attr; u32 ignore_gfp_highmem; u32 ignore_gfp_wait; u32 min_order; - -#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS - - struct dentry *ignore_gfp_highmem_file; - struct dentry *ignore_gfp_wait_file; - struct dentry *min_order_file; - -#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ - } fail_page_alloc = { .attr = FAULT_ATTR_INITIALIZER, .ignore_gfp_wait = 1, @@ -1424,30 +1415,24 @@ static int __init fail_page_alloc_debugfs(void) "fail_page_alloc"); if (err) return err; + dir = fail_page_alloc.attr.dir; - fail_page_alloc.ignore_gfp_wait_file = - debugfs_create_bool("ignore-gfp-wait", mode, dir, - &fail_page_alloc.ignore_gfp_wait); - - fail_page_alloc.ignore_gfp_highmem_file = - debugfs_create_bool("ignore-gfp-highmem", mode, dir, - &fail_page_alloc.ignore_gfp_highmem); - fail_page_alloc.min_order_file = - debugfs_create_u32("min-order", mode, dir, - &fail_page_alloc.min_order); - - if (!fail_page_alloc.ignore_gfp_wait_file || - !fail_page_alloc.ignore_gfp_highmem_file || - !fail_page_alloc.min_order_file) { - err = -ENOMEM; - debugfs_remove(fail_page_alloc.ignore_gfp_wait_file); - debugfs_remove(fail_page_alloc.ignore_gfp_highmem_file); - debugfs_remove(fail_page_alloc.min_order_file); - cleanup_fault_attr_dentries(&fail_page_alloc.attr); - } + if (!debugfs_create_bool("ignore-gfp-wait", mode, dir, + &fail_page_alloc.ignore_gfp_wait)) + goto fail; + if (!debugfs_create_bool("ignore-gfp-highmem", mode, dir, + &fail_page_alloc.ignore_gfp_highmem)) + goto fail; + if (!debugfs_create_u32("min-order", mode, dir, + &fail_page_alloc.min_order)) + goto fail; + + return 0; +fail: + cleanup_fault_attr_dentries(&fail_page_alloc.attr); - return err; + return -ENOMEM; } late_initcall(fail_page_alloc_debugfs);