[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <A9962DF5-1C88-4385-A8DA-20227E055910@dilger.ca>
Date: Thu, 19 Jul 2012 08:42:12 -0700
From: Andreas Dilger <aedilger@...il.com>
To: Wang Sheng-Hui <shhuiw@...il.com>
Cc: ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: One question about ext4_fallocate
On 2012-07-19, at 7:51 AM, Wang Sheng-Hui wrote:
> I have one question about ext4_fallocate:
> For its parameters, offset & len, it will preallocate
> one space with length >= len, right?
>
> From the code:
> map.m_lblk = offset >> blkbits;
> /*
> * We can't just convert len to max_blocks because
> * If blocksize = 4096 offset = 3072 and len = 2048
> */
> max_blocks = (EXT4_BLOCK_ALIGN(len + offset, blkbits) >> blkbits)
> - map.m_lblk;
>
> We can see that the target space is enlarged to the (floor, ceiling) of
> (offset, offset+len). Right?
>
> If I'm wrong, please correct me.
A whole block has to be allocated for fallocate, but if KEEP_SIZE is not used, the i_size should be changed to match the actual requested size.
Cheers, Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists