summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-06-17 22:14:09 +0200
committerChris Mason <chris.mason@oracle.com>2011-06-17 22:38:47 +0200
commite999376f094162aa425ae749aa1df95ab928d010 (patch)
tree080d4a2a20d8d7e7ea8b36f63150827b970da715 /fs/btrfs/delayed-inode.h
parentbtrfs: fix uninitialized return value (diff)
downloadlinux-e999376f094162aa425ae749aa1df95ab928d010.tar.xz
linux-e999376f094162aa425ae749aa1df95ab928d010.zip
Btrfs: avoid delayed metadata items during commits
Snapshot creation has two phases. One is the initial snapshot setup, and the second is done during commit, while nobody is allowed to modify the root we are snapshotting. The delayed metadata insertion code can break that rule, it does a delayed inode update on the inode of the parent of the snapshot, and delayed directory item insertion. This makes sure to run the pending delayed operations before we record the snapshot root, which avoids corruptions. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.h')
-rw-r--r--fs/btrfs/delayed-inode.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
index cb79b6771e82..d1a6a2915c66 100644
--- a/fs/btrfs/delayed-inode.h
+++ b/fs/btrfs/delayed-inode.h
@@ -137,4 +137,8 @@ int btrfs_readdir_delayed_dir_index(struct file *filp, void *dirent,
/* for init */
int __init btrfs_delayed_inode_init(void);
void btrfs_delayed_inode_exit(void);
+
+/* for debugging */
+void btrfs_assert_delayed_root_empty(struct btrfs_root *root);
+
#endif