On Thu, Aug 14, 2008 at 05:14:36PM +1000, Dave Chinner wrote:
> However, this means the linux inodes are unhashed, which means we
> now need to do our own tracking of dirty state. We do this by
> hooking ->dirty_inode and ->set_page_dirty to move the inode to the
> superblock dirty list when appropriate. We also need to hook
> ->drop_inode to ensure we do writeback of dirty inodes during
> reclaim. In future, this can be moved entirely into XFS based on
> radix tree tags to track dirty inodes instead of a separate list.
This part (patches 1, 2 and 3) is horrible, and I think avoidable.
We can just insert the inode into the Linux inode hash anyway, even
if we never use it later. That avoids these whole three patches
and all the duplication of core code inside XFS, including the
inode_lock issue and the potential problem of getting out of sync
when the core code is updated.
If you really, really want to avoid inserting the inode into the Linux
inode cache (and that would need a sound reason) the way to go would
be to remove the assumptions of no writeback for unhashed inodes form
the core code and replace it with a flag that's normally set/cleared
during hashing/unhashing but could also be set/cleared from XFS.