summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/btrfs_inode.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-07-26 21:35:09 +0200
committerChris Mason <chris.mason@oracle.com>2011-07-27 18:46:48 +0200
commit2cf8572dac62cc2ff7e995173e95b6c694401b3f (patch)
treeae37f2f4a2f4a797ee971a94ee2c29c55a8048dc /fs/btrfs/btrfs_inode.h
parentBtrfs: reduce extent_state lock contention for metadata (diff)
downloadlinux-2cf8572dac62cc2ff7e995173e95b6c694401b3f.tar.xz
linux-2cf8572dac62cc2ff7e995173e95b6c694401b3f.zip
Btrfs: use the commit_root for reading free_space_inode crcs
Now that we are using regular file crcs for the free space cache, we can deadlock if we try to read the free_space_inode while we are updating the crc tree. This commit fixes things by using the commit_root to read the crcs. This is safe because we the free space cache file would already be loaded if that block group had been changed in the current transaction. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r--fs/btrfs/btrfs_inode.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 03dce3f40ce0..502b9e988679 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -187,4 +187,13 @@ static inline void btrfs_i_size_write(struct inode *inode, u64 size)
BTRFS_I(inode)->disk_i_size = size;
}
+static inline bool btrfs_is_free_space_inode(struct btrfs_root *root,
+ struct inode *inode)
+{
+ if (root == root->fs_info->tree_root ||
+ BTRFS_I(inode)->location.objectid == BTRFS_FREE_INO_OBJECTID)
+ return true;
+ return false;
+}
+
#endif