whitespace cleanup
[mapsector.git] / lib / 50_scan_reiserfs.sh
index 9c91d31..ed35e3d 100644 (file)
@@ -13,7 +13,7 @@ do_reiserfs()
     local blocksize
     local block
     local subsector
-    
+
     echo "# $device: reiserfs filesystem detected" 1>&2
 
     echo "fstype reiserfs"
@@ -21,10 +21,10 @@ do_reiserfs()
     # Step 6: Get filesystem blocksize and convert sector number to filesystem block number
 
     blocksize="`debugreiserfs $device 2>/dev/null | awk '/^Blocksize:/{print $2/512}'`"
-    
+
     if [ -z "$blocksize" ]; then
-       echo "! $device is not reiserfs" 1>&2
-       exit 1
+        echo "! $device is not reiserfs" 1>&2
+        exit 1
     fi
 
     block="`dc -e "$sector $blocksize ~ n [ ] n p"`" #`"
@@ -38,8 +38,8 @@ do_reiserfs()
     # Step 7: Check, whether block is in use
 
     if debugreiserfs -1 $block $device 2>&1 >/dev/null | grep -qF "free in ondisk bitmap"; then
-       echo "blockstate free"
-       exit 0
+        echo "blockstate free"
+        exit 0
     fi
     echo "blockstate used"
 
@@ -47,16 +47,16 @@ do_reiserfs()
     type="`debugreiserfs -1 $block $device 2>/dev/null | sed -e '/^=*$/d' | head -1`"
 
     case "$type" in
-       "Looks like unformatted")  type="data"          ;;
-       "Reiserfs super block"*)   type="superblock"    ;;
-       "LEAF NODE"*)              type="meta"          ;;
-       "INTERNAL NODE"*)          type="meta"          ;;
-       "Desc block"*)             type="journal"       ;;
-       *)                         type=""              ;;
+        "Looks like unformatted")  type="data"          ;;
+        "Reiserfs super block"*)   type="superblock"    ;;
+        "LEAF NODE"*)              type="meta"          ;;
+        "INTERNAL NODE"*)          type="meta"          ;;
+        "Desc block"*)             type="journal"       ;;
+        *)                         type=""              ;;
     esac
 
     if [ -n "$type" ]; then
-       echo "blocktype $type"
+        echo "blocktype $type"
     fi
 
     # Step 8: Find object id to which this block belongs
@@ -143,21 +143,21 @@ def scan_path(id):
     if entry is None:
         return [ '/' ]
     else:
-       rv = []
-       for name, parent in entry:
-           for path in scan_path(parent):
-               rv.append(os.path.join(path,name))
-       return rv
+        rv = []
+        for name, parent in entry:
+            for path in scan_path(parent):
+                rv.append(os.path.join(path,name))
+        return rv
 
 def parse():
     global fp
     while True:
-       while True:
-           l = fp.readline()
+        while True:
+            l = fp.readline()
             #sys.stderr.write("> parse: %s\n" % repr(l))
-           if not(l) : return
+            if not(l) : return
             if l.strip() == 67*"=" : break
-       parse_leafnode()
+        parse_leafnode()
 
 parse()