All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v6 2/4] fat: skip cluster allocation on fallocated region
Date: Fri, 24 Oct 2014 00:30:50 +0900	[thread overview]
Message-ID: <87k33q951x.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <006d01cfe9fd$35bcff50$a136fdf0$@samsung.com> (Namjae Jeon's message of "Fri, 17 Oct 2014 20:26:35 +0900")

Namjae Jeon <namjae.jeon@samsung.com> writes:

> Skip new cluster allocation after checking i_blocks limit in _fat_get_block,
> because the blocks are already allocated in fallocated region.
>
> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
> ---
>  fs/fat/inode.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index acb45ce..20e9fe5 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -144,7 +144,12 @@ static inline int __fat_get_block(struct inode *inode, sector_t iblock,
>  	}
>  
>  	offset = (unsigned long)iblock & (sbi->sec_per_clus - 1);
> -	if (!offset) {
> +	/*
> +	 * allocate a cluster according to the following.
> +	 * 1) no more available blocks
> +	 * 2) not part of fallocate region
> +	 */
> +	if (!offset && !(iblock < (sector_t)inode->i_blocks)) {
>  		/* TODO: multiple cluster allocation would be desirable. */
>  		err = fat_add_cluster(inode);
>  		if (err)

iblock and i_blocks have different unit. iblock == s_blocksize, 
i_blocks == 9 alwasy.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

      reply	other threads:[~2014-10-23 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 11:26 [PATCH v6 2/4] fat: skip cluster allocation on fallocated region Namjae Jeon
2014-10-23 15:30 ` OGAWA Hirofumi [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=87k33q951x.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=namjae.jeon@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.