public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Tomas Racek <tracek@redhat.com>
Cc: lczerner@redhat.com, xfs@oss.sgi.com
Subject: Re: [PATCH 1/3] Add new standard loop handling functions
Date: Wed, 31 Oct 2012 07:40:38 +1100	[thread overview]
Message-ID: <20121030204038.GY29378@dastard> (raw)
In-Reply-To: <1350549946-17192-1-git-send-email-tracek@redhat.com>

On Thu, Oct 18, 2012 at 10:45:44AM +0200, Tomas Racek wrote:
> 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"
> +}
> +
> +
>  ################################################################################

Perhaps a followup patch that converts existing loop device users to
use this interface is appropriate?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

      parent reply	other threads:[~2012-10-30 20:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121030204038.GY29378@dastard \
    --to=david@fromorbit.com \
    --cc=lczerner@redhat.com \
    --cc=tracek@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox