public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5] lib: make the loop device size can be increased
Date: Tue, 27 Sep 2016 11:25:11 +0800	[thread overview]
Message-ID: <20160927032511.GA24779@gmail.com> (raw)
In-Reply-To: <20160926130715.GB4164@rei.suse.cz>

On Mon, Sep 26, 2016 at 03:07:15PM +0200, Cyril Hrubis wrote:
> Hi!
> > diff --git a/lib/tst_device.c b/lib/tst_device.c
> > index 30b1be2..7effac8 100644
> > --- a/lib/tst_device.c
> > +++ b/lib/tst_device.c
> > @@ -184,8 +184,18 @@ static void detach_device(const char *dev)
> >  
> >  const char *tst_acquire_device(void (cleanup_fn)(void))
> >  {
> > +	return tst_acquire_device_(cleanup_fn, 0);
> > +}
> 
> This can be implemented as static inline function inside the header
> file.

Great! no problem.

> > -	if (tst_fill_file(DEV_FILE, 0, 1024, 153600)) {
> > +	if (tst_fill_file(DEV_FILE, 0, 1024, 1024 * acq_dev_size)) {
> >  		tst_brkm(TBROK | TERRNO, cleanup_fn,
> >  		         "Failed to create " DEV_FILE);
> >  
> > diff --git a/lib/tst_test.c b/lib/tst_test.c
> > index 12ca051..1c2995e 100644
> > --- a/lib/tst_test.c
> > +++ b/lib/tst_test.c
> > @@ -596,7 +596,10 @@ static void do_setup(int argc, char *argv[])
> >  	}
> >  
> >  	if (tst_test->needs_device) {
> > -		tdev.dev = tst_acquire_device(NULL);
> > +		if(!tst_test->device_min_size)
> > +			tst_test->device_min_size = 150;
> 
> The tst_acquire_device_ will make sure that the size is at least 150MB
> anyway. So this part is useless, isn't it?

Yes, it's useless! From what I test on removing them, tst_device.c also works fine.

> 
> Otherwise it looks good.

Thanks for reviewing. Patch v6 is coming...


Li Wang

      reply	other threads:[~2016-09-27  3:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 10:12 [LTP] [PATCH v5] lib: make the loop device size can be increased Li Wang
2016-09-26 13:07 ` Cyril Hrubis
2016-09-27  3:25   ` Li Wang [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=20160927032511.GA24779@gmail.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /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