tech-kern archive

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

Re: [GSoC 2013] Defragmentation for FFS



On 07/25/13 02:23, Mouse wrote:> I'm not sure VFS will/should know anything about it. Since
> fragmentation is a filesystem-specific thing, it seems to me this
> should all happen inside ffs; I wouldn't expect the VFS layer to know
> anything about it.
You are absolutely right. As I said, I did not really think about that
yet. Also I didn't have something in my code where this would be relevant.

> Actually, I suspect you'd get better crash tolerance out of
>
> fs_clean = false
> for each data move operation {
>    allocate new blocks
>    flush allocation bitmaps
>    copy data blocks
>    flush copied block contents
>    update metadata (inode, indirect blocks)
>    flush changed metadata
>    deallocate old blocks
>    flush allocation bitmaps
> }
> fs_clean = true
>
> As for fs_clean, I see little point in setting fs_clean to true after
> each copy only to immediately set it false again in almost all cases.
Jep, this is better than my approach. My idea was to save a whole (probably unnecessary) fsck operation, when a crash happens in between two move operations. Which is pointless now, since the complete analysis part is done before anything is moved. Obviously I forgot to adapt the crash safety stuff, when I started I did not have an analysis step.

Thank you for sharing your thoughts. That was very helpful!

Manuel



Home | Main Index | Thread Index | Old Index