All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Vehlow <lkml@jv-coder.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib: tst_device: Allow more control over the device size
Date: Mon, 2 Aug 2021 14:07:24 +0200	[thread overview]
Message-ID: <e51c9469-73e5-69db-f5ff-c2abfd72dc95@jv-coder.de> (raw)
In-Reply-To: <YQfaZsdzHbPrhCV0@yuki>

Hi,

On 8/2/2021 1:43 PM, Cyril Hrubis wrote:
>>> This is not enough. tst_acquire_device__ calls tst_acquire_loop_device,
>>> that again has MAX(size, DEV_SIZE_MB).
>>> But it should be sage to substitute it for size ? size : DEV_SIZE_MB as
>>> well.
>> Right, that was the old API function to get loop devices which was
>> called from old API testcases. Looks like there are no old API tests
>> that work with loop devices anymore, so this function should be removed
>> from the public API as well. I will send v2 patchset.
> Uff, that was tst_acquire_device_() not tst_acquire_loop_device() and
> tst_acquire_device_() is still in use.
>
> I'm really looking forward to a day where we can finally remove the old
> API from the library...
The usage of foo foo_ and foo__ does not really help in reading the code :)
There could also be some logic errors hiding, e.g. 
tst_acquire_loop_device should probably not default to DEV_SIZE_MB at all.
The caller should be responsible for finding a correct size and the two 
users of this function (tst_device [the binary] and 
tst_acquire_device__) do pass a concrete value for size.

Joerg

  reply	other threads:[~2021-08-02 12:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 13:31 [LTP] [PATCH] lib: tst_device: Allow more control over the device size Cyril Hrubis
2021-08-02  3:16 ` Li Wang
2021-08-02  6:29 ` Joerg Vehlow
2021-08-02 11:38   ` Cyril Hrubis
2021-08-02 11:43     ` Cyril Hrubis
2021-08-02 12:07       ` Joerg Vehlow [this message]
2021-08-02 12:14         ` Cyril Hrubis
2021-08-02 12:21           ` Joerg Vehlow
2021-08-02 13:23             ` Cyril Hrubis

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=e51c9469-73e5-69db-f5ff-c2abfd72dc95@jv-coder.de \
    --to=lkml@jv-coder.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.