File tree Expand file tree Collapse file tree 9 files changed +123
-0
lines changed Expand file tree Collapse file tree 9 files changed +123
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ " $1 " == " hmfs" ]
4+ then
5+ insmod ./hmfs.ko
6+ sudo mount -t hmfs -o physaddr=0x4B000000,init=100M none ~ /mount_hmfs/
7+ elif [ " $1 " == " nohmfs" ]
8+ then
9+ umount ~ /mount_hmfs
10+ rmmod hmfs
11+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ num_file=2048
4+
5+ # create testing files, they will be orphan files later
6+ for (( i= 0 ; i< $num_file ; i++ )) ; do
7+ touch ~ /mount_hmfs/orphan_$i .txt
8+ echo " this is a test file" > ~ /mount_hmfs/orphan_$i .txt
9+ done
10+
11+ echo " $num_file files created..."
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ num_file=2048
4+ for (( i= 0 ; i< $num_file ; i++ )) ; do
5+ # remove the file will create an orhan file
6+ rm ~ /mount_hmfs/orphan_$i .txt
7+ done
8+
9+ echo " $num_file files deleted..."
10+
11+ # check the cmi info
12+ . ./info.sh " cmi"
13+
14+ # sync the file to enforce doing checkpoint
15+ sync
Original file line number Diff line number Diff line change 1+ #!/usr/bin/python3
2+ from os .path import expanduser
3+
4+
5+ home = expanduser ('~' )
6+ file_list = []
7+ for i in range (2048 ):
8+ with open (home + "/mount_hmfs/orphan_{:d}.txt" .format (i ), 'w' ) as file :
9+ file_list .append (file )
10+ file .write ("ssssssssssssssssssss" )
11+
12+ #hold files
13+ while True :
14+ pass
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ hmfs_debug_dir=/sys/kernel/debug/hmfs/1258291200/info
4+ echo " $1 " > ${hmfs_debug_dir} & cat ${hmfs_debug_dir}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # create a 100M file
4+ dd if=/dev/zero of=/opt/dev0-backstore bs=1M count=100
5+
6+ # create the loopback block device
7+ mknod /dev/fake-dev0 b 7 200
8+
9+ losetup /dev/fake-dev0 /opt/dev0-backstore
10+ mount -t f2fs /dev/fake-dev0 ~ /mount_f2fs/
Original file line number Diff line number Diff line change 1+ #include <stdio.h>
2+ #include <stdlib.h>
3+
4+ int main (void )
5+ {
6+ FILE * fps [2048 ];
7+ char filename [100 ];
8+ for (int i = 0 ; i < 2048 ; i ++ ) {
9+ sprintf (filename , "/home/wgtdkp/mount_hmfs/orphan_%d.txt" , i );
10+ printf ("%s\n" , filename );
11+ fps [i ] = fopen (filename , "r" );
12+ if (!fps [i ])
13+ printf ("error!\n" );
14+ }
15+ while (1 ) {}
16+ return 0 ;
17+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ num_file=2048
4+ cd ~ /mount_hmfs/
5+
6+ # create testing files, they will be orphan files later
7+ for (( i= 0 ; i< $num_file ; i++ )) ; do
8+ touch orphan_$i .txt
9+ echo " this is a test file" > orphan_$i .txt
10+ done
11+
12+ echo ${num_file} " file created"
13+
14+ # python3 $HOME/hmfs/fs/hmfs/test/hold_file_open.py &
15+
16+ # for ((i=0; i<$num_file; i++)); do
17+ # remove the file will create an orhan file
18+ # rm orphan_$i.txt
19+ # done
20+
21+ # cd $HOME/hmfs/fs/hmfs/test/
22+ # check the cmi info
23+ # . ./info.sh "cmi"
24+
25+ # sync the file to enforce doing checkpoint
26+ # sync
27+
28+
29+
30+
31+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cd $HOME /hmfs/fs/hmfs/test/
4+
5+ . ./create.sh
6+ . ./delete.sh
7+ . ./create.sh
8+ . ./delete.sh
9+ . ./create.sh
10+ . ./delete.sh
You can’t perform that action at this time.
0 commit comments