When is a block free?

Chris Worley worleys at gmail.com
Mon Sep 29 15:24:33 UTC 2008


On Tue, Sep 16, 2008 at 3:32 PM, Chris Worley <worleys at gmail.com> wrote:
> For example, in balloc.c I'm seeing ext3_free_blocks_sb
> calls ext3_clear_bit_atomic at the bottom... is that when the block is
> freed?  Are all blocks freed here?

David Woodhouse, in an article at http://lwn.net/Articles/293658/, is
implementing the T10/T13 committees "Trim" request in 2.6.28 kernels.

Would it be appropriate to call "blkdev_issue_discard" at the bottom
of ext3_free_blocks_sb where ext3_clear_bit_atomic is being called?

Chris
>
> On Tue, Sep 16, 2008 at 3:03 PM, Chris Worley <worleys at gmail.com> wrote:
>>
>> On Tue, Sep 16, 2008 at 2:17 PM, Ric Wheeler <rwheeler at redhat.com> wrote:
>>>
>>> Chris Worley wrote:
>>>>
>>>> Where in the ext2/3 code does it know that a block on the disk is now
>>>> free to reuse?
>>>>
>>>> Thanks,
>>>>
>>>> Chris
>>>
>>> Hi Chris,
>>>
>>> File systems track which blocks are free from the file system creation
>>> time (mkfs), creation of new files and deletion. Ext2/3 is the gatekeeper
>>> for all deletions, so it knows when file system blocks transition from the
>>> used state to the free state. Ext file system use bitmaps to track the
>>> blocks that are allocated or not.
>>
>> Where (in the code... what routine... or what's the name of the bitmap) is
>> the "free" bit set?  I've been looking through the code and don't see
>> exactly where the block is marked as free.
>> Thanks,
>> Chris
>>>
>>> Regards,
>>>
>>> Ric
>>>
>>
>
>




More information about the Ext3-users mailing list