linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Sasikanth V <sasikanth.v19@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mel@csn.ul.ie>, Christoph Lameter <cl@linux.com>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm:vmstat - Removed debug fs entries on failure of file creation and made extfrag_debug_root dentry local
Date: Mon, 23 Apr 2012 15:08:01 -0400	[thread overview]
Message-ID: <CAHGf_=rKK_s=cMTKcaAsyjVgKCoBHPyPfBdHaGo_FiigCMezRg@mail.gmail.com> (raw)
In-Reply-To: <1335207012-25133-1-git-send-email-sasikanth.v19@gmail.com>

On Mon, Apr 23, 2012 at 2:50 PM, Sasikanth V <sasikanth.v19@gmail.com> wrote:
> Removed debug fs files and directory on failure. Since no one using "extfrag_debug_root" dentry outside of function
> extfrag_debug_init made it local to the function.
>
> Signed-off-by: Sasikanth V <sasikanth.v19@gmail.com>
> ---
>  mm/vmstat.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index f600557..ddae476 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1220,7 +1220,6 @@ module_init(setup_vmstat)
>  #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION)
>  #include <linux/debugfs.h>
>
> -static struct dentry *extfrag_debug_root;
>
>  /*
>  * Return an index indicating how much of the available free memory is
> @@ -1358,17 +1357,23 @@ static const struct file_operations extfrag_file_ops = {
>
>  static int __init extfrag_debug_init(void)
>  {
> +       struct dentry *extfrag_debug_root;
> +
>        extfrag_debug_root = debugfs_create_dir("extfrag", NULL);
>        if (!extfrag_debug_root)
>                return -ENOMEM;
>
>        if (!debugfs_create_file("unusable_index", 0444,
> -                       extfrag_debug_root, NULL, &unusable_file_ops))
> +                       extfrag_debug_root, NULL, &unusable_file_ops)) {
> +               debugfs_remove (extfrag_debug_root);
>                return -ENOMEM;
> +       }
>
>        if (!debugfs_create_file("extfrag_index", 0444,
> -                       extfrag_debug_root, NULL, &extfrag_file_ops))
> +                       extfrag_debug_root, NULL, &extfrag_file_ops)) {
> +               debugfs_remove_recursive (extfrag_debug_root);
>                return -ENOMEM;
> +       }

Looks good.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-04-23 19:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 18:50 Sasikanth V
2012-04-23 19:08 ` KOSAKI Motohiro [this message]
2012-04-23 19:08 Sasikantha babu
2012-04-23 20:35 ` David Rientjes
2012-04-23 21:15   ` Sasikanth babu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHGf_=rKK_s=cMTKcaAsyjVgKCoBHPyPfBdHaGo_FiigCMezRg@mail.gmail.com' \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=rientjes@google.com \
    --cc=sasikanth.v19@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox