Re: [PATCH v6 2/4] fat: skip cluster allocation on fallocated region

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Namjae Jeon <namjae.jeon@xxxxxxxxxxx> 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@xxxxxxxxxxx>
> Signed-off-by: Amit Sahrawat <a.sahrawat@xxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux