mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
82d5902d9c
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>
13 lines
455 B
C
13 lines
455 B
C
#ifndef __BTRFS_INODE_MAP
|
|
#define __BTRFS_INODE_MAP
|
|
|
|
void btrfs_init_free_ino_ctl(struct btrfs_root *root);
|
|
void btrfs_unpin_free_ino(struct btrfs_root *root);
|
|
void btrfs_return_ino(struct btrfs_root *root, u64 objectid);
|
|
int btrfs_find_free_ino(struct btrfs_root *root, u64 *objectid);
|
|
int btrfs_save_ino_cache(struct btrfs_root *root,
|
|
struct btrfs_trans_handle *trans);
|
|
|
|
int btrfs_find_free_objectid(struct btrfs_root *root, u64 *objectid);
|
|
|
|
#endif
|