public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Add new standard loop handling functions
@ 2012-10-18  8:45 Tomas Racek
  2012-10-18  8:45 ` [PATCH 2/3] Provide dumpe2fs via standard common.config interface Tomas Racek
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Tomas Racek @ 2012-10-18  8:45 UTC (permalink / raw)
  To: xfs; +Cc: lczerner, Tomas Racek

Add _create_loop_device and _destroy_loop_device to uniformly handle
loopback devices.

Signed-off-by: Tomas Racek <tracek@redhat.com>
---
 common.rc | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common.rc b/common.rc
index 966fc93..b5edd22 100644
--- a/common.rc
+++ b/common.rc
@@ -1804,6 +1804,21 @@ _test_batched_discard()
 	$FSTRIM_PROG ${1} &>/dev/null
 }
 
+_create_loop_device()
+{
+	file=$1
+	dev=`losetup -f`
+	losetup $dev $file || _fail "Cannot associate $file with $dev"
+	echo $dev
+}
+
+_destroy_loop_device()
+{
+	dev=$1
+	losetup -d $dev || _fail "Cannot destroy loop device $dev"
+}
+
+
 ################################################################################
 
 if [ "$iam" != new -a "$iam" != bench ]
-- 
1.7.11.7

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-30 21:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18  8:45 [PATCH 1/3] Add new standard loop handling functions Tomas Racek
2012-10-18  8:45 ` [PATCH 2/3] Provide dumpe2fs via standard common.config interface Tomas Racek
2012-10-30 20:18   ` Rich Johnston
2012-10-18  8:45 ` [PATCH 3/3] 289: Test that filesystem sends discard requests only on free sectors Tomas Racek
2012-10-30 20:18   ` Rich Johnston
2012-10-30 21:18   ` Dave Chinner
2012-10-30 20:17 ` [PATCH 1/3] Add new standard loop handling functions Rich Johnston
2012-10-30 20:40 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox