linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: zhangxirui via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: jaegeuk@kernel.org, chao@kernel.org
Cc: zhangxirui <xirui.zhang@vivo.com>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH] f2fs-tools: skip check device mount state in sparse mode
Date: Thu, 25 Jan 2024 23:37:23 -0700	[thread overview]
Message-ID: <20240126063723.2926123-1-xirui.zhang@vivo.com> (raw)

In sparse mode we just read or write to a sparse file not a block device
so no need to check device mount state in sparse mode.

Signed-off-by: zhangxirui <xirui.zhang@vivo.com>
---
 lib/libf2fs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index 2451201..5315de2 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -830,6 +830,10 @@ int f2fs_devs_are_umounted(void)
 {
 	int i;
 
+	/*no need to check device mount state in sparse mode*/
+	if (c.sparse_mode)
+		return 0;
+
 	for (i = 0; i < c.ndevs; i++)
 		if (f2fs_dev_is_umounted((char *)c.devices[i].path))
 			return -1;
-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply	other threads:[~2024-01-26  6:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  6:37 zhangxirui via Linux-f2fs-devel [this message]
2024-01-31  7:39 ` [f2fs-dev] [PATCH] f2fs-tools: skip check device mount state in sparse mode Chao Yu
2024-02-01  6:40   ` zhangxirui via Linux-f2fs-devel
2024-02-01  6:37     ` Chao Yu
2024-02-01  7:17   ` zhangxirui via Linux-f2fs-devel

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=20240126063723.2926123-1-xirui.zhang@vivo.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=xirui.zhang@vivo.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;
as well as URLs for NNTP newsgroup(s).