_dmapi_scratch_mount changes
authorAllan Randall <allanr@sgi.com>
Thu, 4 Jan 2007 05:12:36 +0000 (05:12 +0000)
committerAllan Randall <allanr@sgi.com>
Thu, 4 Jan 2007 05:12:36 +0000 (05:12 +0000)
Merge of master-melb:xfs-cmds:27847a by kenmcd.

  changed _dmapi_scratch_mount to determine dmapi support by attempting to mount the filesystem with the dmapi mount option and checking it succeeds

common.dmapi

index 10409c30531c8647b54c9d2d3de32e2af9e473bf..239681085c065fa9a2cde6e930ad2bee82c2cf32 100644 (file)
@@ -13,15 +13,17 @@ DMAPI_QASUITE2_DIR=$here/dmapi/src/suite2/
 DMAPI_LS_TO_COPY_PATH=$DMAPI_QASUITE2_DIR/bindir/ls_to_copy
 
 _dmapi_scratch_mount () {
-    if [ `lsmod | grep -c dmapi` -gt 0 ] ; then
-        if [ `echo "$MOUNT_OPTIONS" | grep -c dmapi` -gt 0 -o \
-            `echo "$MOUNT_OPTIONS" | grep -c dmi` -gt 0 ] ; then
-            #already got dmapi options set
-            _scratch_mount
-        else
-            _scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
-        fi
+    if [ `echo "$MOUNT_OPTIONS" | grep -c dmapi` -gt 0 -o \
+        `echo "$MOUNT_OPTIONS" | grep -c dmi` -gt 0 ] ; then
+        #already got dmapi options set
+        _scratch_mount
+        dmapi_mount_result=$?
     else
-        _notrun "DMAPI modules not loaded"
+        _scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
+        dmapi_mount_result=$?
     fi
-}
+
+    if [ $dmapi_mount_result -ne 0 ] ; then
+        _notrun "Assuming DMAPI modules are not loaded"
+    fi
+}
\ No newline at end of file