Btrfs: Support reading/writing on disk free ino cache
authorLi Zefan <lizf@cn.fujitsu.com>
Wed, 20 Apr 2011 02:33:24 +0000 (10:33 +0800)
committerLi Zefan <lizf@cn.fujitsu.com>
Mon, 25 Apr 2011 08:46:11 +0000 (16:46 +0800)
commit82d5902d9c681be37ffa9d70482907f9f0b7ec1f
treec9c99f0b60004ac14d09d277d3216667df09c32d
parent33345d01522f8152f99dc84a3e7a1a45707f387f
Btrfs: Support reading/writing on disk free ino cache

This is similar to block group caching.

We dedicate a special inode in fs tree to save free ino cache.

At the very first time we create/delete a file after mount, the free ino
cache will be loaded from disk into memory. When the fs tree is commited,
the cache will be written back to disk.

To keep compatibility, we check the root generation against the generation
of the special inode when loading the cache, so the loading will fail
if the btrfs filesystem was mounted in an older kernel before.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.h
fs/btrfs/inode-map.c
fs/btrfs/inode-map.h
fs/btrfs/inode.c
fs/btrfs/transaction.c