Skip to contentSkip to conversation

btrfs-progs: Add fast,slow symlinks and fifo types to convert test

PATCH In review Lakshmipathi.G 2 participants 4 messages Sep 15, 2016 – Sep 20, 2016 1 message not in the archive Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-progs: Add fast,slow symlinks and fifo types to convert test

---
 tests/common.convert | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
tests/common.convert +15 -3
index 67c99b1..2790be5 100644
@@ -25,10 +25,10 @@ generate_dataset() {
 			done
 			;;
 
-		symlink)
+		fast_symlink)
 			for num in $(seq 1 $DATASET_SIZE); do
 				run_check $SUDO_HELPER touch $dirpath/$dataset_type.$num
-				run_check $SUDO_HELPER ln -s $dirpath/$dataset_type.$num $dirpath/slink.$num
+				run_check $SUDO_HELPER cd $dirpath && ln -s $dataset_type.$num $dirpath/slink.$num && cd /
 			done
 			;;
 
@@ -71,12 +71,24 @@ generate_dataset() {
 				run_check $SUDO_HELPER setfattr -n user.foo -v bar$num $dirpath/$dataset_type.$num
 			done
 			;;
+		fifo)
+			for num in $(seq 1 $DATASET_SIZE); do
+				run_check $SUDO_HELPER mkfifo $dirpath/$dataset_type.$num
+			done
+			;;
+		slow_symlink)
+			for num in $(seq 1 $DATASET_SIZE); do
+				fname64=`date +%s | sha256sum | cut -f1 -d'-'`
+				run_check $SUDO_HELPER touch $dirpath/$fname64
+				run_check $SUDO_HELPER ln -s $dirpath/$fname64 $dirpath/slow_slink.$num
+			done
+			;;
 	esac
 }
 
 populate_fs() {
 
-        for dataset_type in 'small' 'hardlink' 'symlink' 'brokenlink' 'perm' 'sparse' 'acls'; do
+        for dataset_type in 'small' 'hardlink' 'fast_symlink' 'brokenlink' 'perm' 'sparse' 'acls' 'fifo' 'slow_symlink'; do
 		generate_dataset "$dataset_type"
 	done
 }
Signature · 1 line
1.9.3
#1 lore raw

tests/common.convert generate_dataset() { · line 81

Quoted 3 lines · Lakshmipathi.G
tests/common.convert +3 -0
+		slow_symlink)
+			for num in $(seq 1 $DATASET_SIZE); do
+				fname64=`date +%s | sha256sum | cut -f1 -d'-'`

Do you need to generate the date and sha all the time?

Quoted 21 lines
tests/common.convert +5 -1
+				run_check $SUDO_HELPER touch $dirpath/$fname64
+				run_check $SUDO_HELPER ln -s $dirpath/$fname64 $dirpath/slow_slink.$num
+			done
+			;;
 	esac
 }
 
 populate_fs() {
 
-        for dataset_type in 'small' 'hardlink' 'symlink' 'brokenlink' 'perm' 'sparse' 'acls'; do
+        for dataset_type in 'small' 'hardlink' 'fast_symlink' 'brokenlink' 'perm' 'sparse' 'acls' 'fifo' 'slow_symlink'; do
 		generate_dataset "$dataset_type"
 	done
 }
Signature · 6 lines
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 7 lines · David Sterba

tests/common.convert generate_dataset() { · line 81

Quoted 3 lines · Lakshmipathi.G
tests/common.convert +3 -0
+		slow_symlink)
+			for num in $(seq 1 $DATASET_SIZE); do
+				fname64=`date +%s | sha256sum | cut -f1 -d'-'`

Do you need to generate the date and sha all the time?

Right, I missed that part. We can create a single file and create multiple symlink to that same file. fname64 creation can be moved out of the loop. I'll re-send another patch with this fix.

Cheers.
Lakshmipathi.G

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 4 lines · Qu Wenruo

Just curious, did the new fifo/slow_symlink exposed any convert bug?

Thanks,
Qu

Unfortunately no. I was hoping something will fail, but sadly convert-tests.sh passed!