Re: [PATCH 7/6] fat: Support a truncate() for expanding size

From: OGAWA Hirofumi
Date: Mon Nov 07 2005 - 22:20:08 EST


Andrew Morton <akpm@xxxxxxxx> writes:

> OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx> wrote:
>>
>> +static int fat_cont_expand(struct inode *inode, loff_t size)
>
> Is it not possible to extend generic_cont_expand() so that fatfs can use it?

The generic_cont_expand() is too generic.

If "size" is block boundary, generic_cont_expand() expands the
->i_size to "size + 1", after it, the caller of it will truncate to
"size" by vmtruncate().

This sequence is not need if ->prepare_write() is cont_prepare_write().
The cont_prepare_write() will just fill the blocks with zero until
"size" if blocks is not allocated yet.

FAT is using cont_parepare_write(), so for avoiding the above extra
work, is using own version.

Probably, this version is generic only for cont_parepare_write().

Thanks.
--
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/