From e21bfc88e3273b4beb1386a6b4cc14188e3d3b78 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 17 Sep 2014 21:04:06 +0400 Subject: [PATCH] simple-test: mount fs with journal --- simple-test.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/simple-test.sh b/simple-test.sh index 45d153c..d0102f2 100755 --- a/simple-test.sh +++ b/simple-test.sh @@ -21,6 +21,11 @@ root_pwd="$PWD" test_dir="test-dir-$RANDOM" test_mount_point="test-mount-point-$RANDOM" +function create_journal() +{ + dd bs=1M count=10 if=/dev/zero of="$1" + mke2fs -O journal_dev "$1" +} function create_test_image() { dd bs=4096 count=100 if=/dev/zero of="$1" @@ -29,7 +34,7 @@ function create_test_image() function mount_fs_image() { insmod simplefs.ko - mount -o loop,owner,group,users -t simplefs "$1" "$2" + mount -o loop,owner,group,users,journal_path="$1" -t simplefs "$2" "$3" dmesg | tail -n20 } function unmount_fs() @@ -108,15 +113,16 @@ cleanup trap cleanup SIGINT EXIT mkdir "$test_dir" "$test_mount_point" create_test_image "$test_dir/image" +create_journal "$test_dir/journal" # 1 -mount_fs_image "$test_dir/image" "$test_mount_point" +mount_fs_image "$test_dir/journal" "$test_dir/image" "$test_mount_point" do_some_operations "$test_mount_point" cd "$root_pwd" unmount_fs "$test_mount_point" # 2 -mount_fs_image "$test_dir/image" "$test_mount_point" +mount_fs_image "$test_dir/journal" "$test_dir/image" "$test_mount_point" do_read_operations "$test_mount_point" cd "$root_pwd" unmount_fs "$test_mount_point"