linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Wang Sheng-Hui <shhuiw@gmail.com>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] mm: trivial code style fix to shmem_statfs
Date: Mon, 14 Jul 2014 12:36:34 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LSU.2.11.1407141231370.17582@eggly.anvils> (raw)
In-Reply-To: <53C38C3A.3090903@gmail.com>

On Mon, 14 Jul 2014, Wang Sheng-Hui wrote:
> 
> Should read the super_block fields, even if current implementation uses
> the same constants.
> 
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>

I prefer how it is already, more direct, less code.
They are very unlikely to change: if they do, we can update then.

If you're looking for a trivial patch to make in mm/shmem.c,
I suggest removing the unused gfp arg to shmem_add_to_page_cache().

Hugh

> ---
>  mm/shmem.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 1140f49..368523b 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -1874,10 +1874,11 @@ out:
> 
>  static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf)
>  {
> -       struct shmem_sb_info *sbinfo = SHMEM_SB(dentry->d_sb);
> +       struct super_block *sb = dentry->d_sb;
> +       struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
> 
> -       buf->f_type = TMPFS_MAGIC;
> -       buf->f_bsize = PAGE_CACHE_SIZE;
> +       buf->f_type = sb->s_magic;
> +       buf->f_bsize = sb->s_blocksize;
>         buf->f_namelen = NAME_MAX;
>         if (sbinfo->max_blocks) {
>                 buf->f_blocks = sbinfo->max_blocks;
> -- 
> 1.8.3.2

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2014-07-14 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14  7:52 Wang Sheng-Hui
2014-07-14 19:36 ` Hugh Dickins [this message]

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=alpine.LSU.2.11.1407141231370.17582@eggly.anvils \
    --to=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=shhuiw@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