diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-09-10 19:58:36 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-09-10 19:58:36 -0400 |
commit | 011410bd859a481a335d7db1fb559542c5663fd5 (patch) | |
tree | 39b7d65352f49abe4eeb9cabd3b19d1b50faf9a2 /fs/btrfs/disk-io.c | |
parent | 86479a04eef8f304a13aeb8b64bcc8e506a68268 (diff) |
Btrfs: Add more synchronization before creating a snapshot
File data checksums are only done during writepage, so we have to make sure
all pages are written when the snapshot is taken. This also adds some
locking so that new writes don't race in and add new dirty pages.
Signed-off-by: Chris Mason <chris.mason@oracle.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 c25ef0a68f18..6c953a0e0aa3 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -300,6 +300,7 @@ static int __setup_root(int blocksize, | |||
300 | memset(&root->defrag_progress, 0, sizeof(root->defrag_progress)); | 300 | memset(&root->defrag_progress, 0, sizeof(root->defrag_progress)); |
301 | memset(&root->root_kobj, 0, sizeof(root->root_kobj)); | 301 | memset(&root->root_kobj, 0, sizeof(root->root_kobj)); |
302 | init_completion(&root->kobj_unregister); | 302 | init_completion(&root->kobj_unregister); |
303 | init_rwsem(&root->snap_sem); | ||
303 | root->defrag_running = 0; | 304 | root->defrag_running = 0; |
304 | root->defrag_level = 0; | 305 | root->defrag_level = 0; |
305 | root->root_key.objectid = objectid; | 306 | root->root_key.objectid = objectid; |