All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/5] lib/tst_device: Export more functions.
Date: Thu, 22 Aug 2019 11:31:22 +0200	[thread overview]
Message-ID: <1566466282.3467.10.camel@suse.de> (raw)
In-Reply-To: <20190820151831.7418-2-chrubis@suse.cz>

Reviewed-by: Clemens Famulla-Conrad <cfamullaconrad@suse.de>

On Tue, 2019-08-20 at 17:18 +0200, Cyril Hrubis wrote:
> Export tst_attach_device() and tst_deteach_device() which will be
> later
> on used by a kernel netlink uevent tests.
> 
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
>  include/tst_device.h | 7 +++++++
>  lib/tst_device.c     | 8 ++++----
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/tst_device.h b/include/tst_device.h
> index f0ddc3e93..c6e7b45b1 100644
> --- a/include/tst_device.h
> +++ b/include/tst_device.h
> @@ -50,6 +50,13 @@ int tst_clear_device(const char *dev);
>   *
>   */
>  int tst_find_free_loopdev(const char *path, size_t path_len);
> +
> +
> +int tst_attach_device(const char *dev_path, const char *file_path);
> +
> +
> +int tst_detach_device(const char *dev_path);
> +
>  /*
>   * Reads test block device stat file and returns the bytes written
> since the
>   * last call of this function.
> diff --git a/lib/tst_device.c b/lib/tst_device.c
> index 22abdef46..10f71901d 100644
> --- a/lib/tst_device.c
> +++ b/lib/tst_device.c
> @@ -139,7 +139,7 @@ int tst_find_free_loopdev(char *path, size_t
> path_len)
>  	return -1;
>  }
>  
> -static int attach_device(const char *dev, const char *file)
> +int tst_attach_device(const char *dev, const char *file)
>  {
>  	int dev_fd, file_fd;
>  	struct loop_info loopinfo;
> @@ -185,7 +185,7 @@ static int attach_device(const char *dev, const
> char *file)
>  	return 0;
>  }
>  
> -static int detach_device(const char *dev)
> +int tst_detach_device(const char *dev)
>  {
>  	int dev_fd, ret, i;
>  
> @@ -284,7 +284,7 @@ const char *tst_acquire_device__(unsigned int
> size)
>  	if (tst_find_free_loopdev(dev_path, sizeof(dev_path)) == -1)
>  		return NULL;
>  
> -	if (attach_device(dev_path, DEV_FILE))
> +	if (tst_attach_device(dev_path, DEV_FILE))
>  		return NULL;
>  
>  	device_acquired = 1;
> @@ -329,7 +329,7 @@ int tst_release_device(const char *dev)
>  	 *
>  	 * The file image is deleted in tst_rmdir();
>  	 */
> -	ret = detach_device(dev);
> +	ret = tst_detach_device(dev);
>  
>  	device_acquired = 0;
>  
> -- 
> 2.21.0
> 
> 

  reply	other threads:[~2019-08-22  9:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 15:18 [LTP] [PATCH v1 0/5] Add basic test for uevent netlink socket Cyril Hrubis
2019-08-20 15:18 ` [LTP] [PATCH v2 1/5] lib/tst_device: Export more functions Cyril Hrubis
2019-08-22  9:31   ` Clemens Famulla-Conrad [this message]
2019-08-20 15:18 ` [LTP] [PATCH v2 2/5] kernel/uevent: Add uevent01 Cyril Hrubis
2019-08-21 16:35   ` Clemens Famulla-Conrad
2019-08-26 11:47     ` Cyril Hrubis
2019-08-20 15:18 ` [LTP] [PATCH v2 3/5] kernel/uevent: Add uevent02 Cyril Hrubis
2019-08-21 16:35   ` Clemens Famulla-Conrad
2019-08-26 11:45     ` Cyril Hrubis
2019-08-20 15:18 ` [LTP] [PATCH v2 4/5] libs/libltpuinput: Add uinput library Cyril Hrubis
2019-08-22  9:12   ` Clemens Famulla-Conrad
2019-08-20 15:18 ` [LTP] [PATCH v2 5/5] kernel/uevent: Add uevent03 Cyril Hrubis
2019-08-22  9:00   ` Clemens Famulla-Conrad
2019-08-26 13:55     ` 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=1566466282.3467.10.camel@suse.de \
    --to=cfamullaconrad@suse.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.