summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-05-05 09:45:26 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2008-05-05 09:45:26 -0400
commita62332eeb2235ef1cbdd270323bc68e106c632ac (patch)
treeb8333ec9dbe1d653ed2ea922fd6d05cd0daee9c1 /mkfs.c
parentaaf38b3ebd2fa9cb6948ff1d6a2cfda063170a6e (diff)
Add a readonly flag open_ctree to force RO opens
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mkfs.c b/mkfs.c
index 740cc81d..e1b42971 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -77,7 +77,7 @@ static int make_root_dir(int fd, const char *device_name) {
u64 chunk_size = 0;
int ret;
- root = open_ctree_fd(fd, device_name, 0);
+ root = open_ctree_fd(fd, device_name, 0, O_RDWR);
if (!root) {
fprintf(stderr, "ctree init failed\n");
@@ -408,7 +408,7 @@ int main(int ac, char **av)
fprintf(stderr, "failed to setup the root directory\n");
exit(1);
}
- root = open_ctree(file, 0);
+ root = open_ctree(file, 0, O_RDWR);
root->fs_info->alloc_start = alloc_start;
trans = btrfs_start_transaction(root, 1);