All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] lib: mount tmpfs name as ltp-tmpfs
Date: Thu,  1 Jul 2021 13:52:08 +0800	[thread overview]
Message-ID: <20210701055208.715395-2-liwang@redhat.com> (raw)
In-Reply-To: <20210701055208.715395-1-liwang@redhat.com>

Given a specific name as "ltp-tmpfs" instead of the "/dev/loopX"
string in order to make "tmpfs" filesystem more evident.

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Li Wang <liwang@redhat.com>
---
 lib/tst_test.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 27766fbfd..ab343e593 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -896,19 +896,23 @@ static void prepare_device(void)
 	}
 
 	if (tst_test->mount_device) {
+		const char *path_name = tdev.dev;
 		char *mnt_data = tst_test->mnt_data;
 
 		if (!strcmp(tdev.fs_type, "tmpfs")) {
 			tst_test->mnt_data = limit_tmpfs_mount_size(tst_test->mnt_data,
 					tst_test->dev_min_size);
+			tdev.dev = "ltp-tmpfs";
 		}
 
 		SAFE_MOUNT(tdev.dev, tst_test->mntpoint, tdev.fs_type,
 			   tst_test->mnt_flags, tst_test->mnt_data);
 		mntpoint_mounted = 1;
 
-		if (!strcmp(tdev.fs_type, "tmpfs"))
+		if (!strcmp(tdev.fs_type, "tmpfs")) {
 			tst_test->mnt_data = mnt_data;
+			tdev.dev = path_name;
+		}
 	}
 }
 
-- 
2.31.1


  reply	other threads:[~2021-07-01  5:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  5:52 [LTP] [PATCH 1/2] lib: limit the size of tmpfs in LTP Li Wang
2021-07-01  5:52 ` Li Wang [this message]
2021-07-02  9:23   ` [LTP] [PATCH 2/2] lib: mount tmpfs name as ltp-tmpfs Cyril Hrubis
2021-07-02  9:21 ` [LTP] [PATCH 1/2] lib: limit the size of tmpfs in LTP Cyril Hrubis
2021-07-02 12:01   ` Li Wang
2021-07-02 11:40     ` Cyril Hrubis
2021-07-02 12:20       ` Li Wang

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=20210701055208.715395-2-liwang@redhat.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 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.