aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-23 10:01:08 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-23 10:01:08 -0400
commitd571976292839cec05a2820b08f7629b145ed157 (patch)
tree6a3f2f5a9b9c70f61d00ac10edaaaa60d5043474 /fs/btrfs/disk-io.c
parent79154b1b5bcf87903db7ff16a30b360b78d6fe4f (diff)
btrfs_create, btrfs_write_super, btrfs_sync_fs
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 9cacca0c525c..8e1dcda0839c 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -145,19 +145,20 @@ struct btrfs_root *open_ctree(struct super_block *sb,
145int write_ctree_super(struct btrfs_trans_handle *trans, struct btrfs_root 145int write_ctree_super(struct btrfs_trans_handle *trans, struct btrfs_root
146 *root) 146 *root)
147{ 147{
148 return 0; 148 struct buffer_head *bh = root->fs_info->sb_buffer;
149#if 0 149 btrfs_set_super_root(root->fs_info->disk_super,
150 int ret; 150 root->fs_info->tree_root->node->b_blocknr);
151 btrfs_set_super_root(s, root->fs_info->tree_root->node->b_blocknr); 151 lock_buffer(bh);
152 152 clear_buffer_dirty(bh);
153 ret = pwrite(root->fs_info->fp, s, sizeof(*s), 153 bh->b_end_io = end_buffer_write_sync;
154 BTRFS_SUPER_INFO_OFFSET); 154 get_bh(bh);
155 if (ret != sizeof(*s)) { 155 submit_bh(WRITE, bh);
156 fprintf(stderr, "failed to write new super block err %d\n", ret); 156 wait_on_buffer(bh);
157 return ret; 157 if (!buffer_uptodate(bh)) {
158 WARN_ON(1);
159 return -EIO;
158 } 160 }
159 return 0; 161 return 0;
160#endif
161} 162}
162 163
163int close_ctree(struct btrfs_root *root) 164int close_ctree(struct btrfs_root *root)