diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-04-19 22:33:24 -0400 |
---|---|---|
committer | Li Zefan <lizf@cn.fujitsu.com> | 2011-04-25 04:46:11 -0400 |
commit | 82d5902d9c681be37ffa9d70482907f9f0b7ec1f (patch) | |
tree | c9c99f0b60004ac14d09d277d3216667df09c32d /fs/btrfs/disk-io.c | |
parent | 33345d01522f8152f99dc84a3e7a1a45707f387f (diff) |
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>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d02683b1ee16..4f12c30a5470 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2505,6 +2505,7 @@ int btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root) | |||
2505 | 2505 | ||
2506 | static void free_fs_root(struct btrfs_root *root) | 2506 | static void free_fs_root(struct btrfs_root *root) |
2507 | { | 2507 | { |
2508 | iput(root->cache_inode); | ||
2508 | WARN_ON(!RB_EMPTY_ROOT(&root->inode_tree)); | 2509 | WARN_ON(!RB_EMPTY_ROOT(&root->inode_tree)); |
2509 | if (root->anon_super.s_dev) { | 2510 | if (root->anon_super.s_dev) { |
2510 | down_write(&root->anon_super.s_umount); | 2511 | down_write(&root->anon_super.s_umount); |