From 67de11769bd5ec339a62169f500b04f304826c00 Mon Sep 17 00:00:00 2001 From: Miao Xie Date: Thu, 26 Dec 2013 13:07:06 +0800 Subject: Btrfs: introduce the delayed inode ref deletion for the single link inode The inode reference item is close to inode item, so we insert it simultaneously with the inode item insertion when we create a file/directory.. In fact, we also can handle the inode reference deletion by the same way. So we made this patch to introduce the delayed inode reference deletion for the single link inode(At most case, the file doesn't has hard link, so we don't take the hard link into account). This function is based on the delayed inode mechanism. After applying this patch, we can reduce the time of the file/directory deletion by ~10%. Signed-off-by: Miao Xie Signed-off-by: Chris Mason --- fs/btrfs/delayed-inode.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/btrfs/delayed-inode.h') diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h index a6a13f7e014d..f70119f25421 100644 --- a/fs/btrfs/delayed-inode.h +++ b/fs/btrfs/delayed-inode.h @@ -50,6 +50,7 @@ struct btrfs_delayed_root { #define BTRFS_DELAYED_NODE_IN_LIST 0 #define BTRFS_DELAYED_NODE_INODE_DIRTY 1 +#define BTRFS_DELAYED_NODE_DEL_IREF 2 struct btrfs_delayed_node { u64 inode_id; @@ -127,6 +128,7 @@ int btrfs_commit_inode_delayed_inode(struct inode *inode); int btrfs_delayed_update_inode(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct inode *inode); int btrfs_fill_inode(struct inode *inode, u32 *rdev); +int btrfs_delayed_delete_inode_ref(struct inode *inode); /* Used for drop dead root */ void btrfs_kill_all_delayed_nodes(struct btrfs_root *root); -- cgit v1.2.3