All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: mwilck@suse.de
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	dm-devel@lists.linux.dev, Martin Wilck <mwilck@suse.com>
Subject: Re: [PATCH 4/4] libmultipath: use mmap in lookup_wwid()
Date: Wed, 30 Sep 2026 20:06:53 -0400	[thread overview]
Message-ID: <ar2kHTTbrVuDrctn@redhat.com> (raw)
In-Reply-To: <20260925214014.2464499-5-mwilck@suse.de>

On Fri, Sep 25, 2026 at 11:40:09PM +0200, mwilck@suse.de wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> Replace the line-by-line reading in lookup_wwid() with mmap()
> and a simple loop over the in-memory structures.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  libmultipath/wwids.c | 71 ++++++++++++++++++++++++--------------------
>  1 file changed, 38 insertions(+), 33 deletions(-)
> 
> diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c
> index c193b97..42455de 100644
> --- a/libmultipath/wwids.c
> +++ b/libmultipath/wwids.c

[snip]

> @@ -245,7 +250,7 @@ int check_wwids_file(const char *wwid, int write_wwid)

Since lookup_wwid now takes a fd, check_wwids_file() doesn't need the
fdopen() anymore, right?

-Ben

>  		close(fd);
>  		return -1;
>  	}
> -	found = lookup_wwid(f, wwid);
> +	found = lookup_wwid(fd, wwid);
>  	if (found) {
>  		ret = 0;
>  		goto out;
> -- 
> 2.55.0
> 


      reply	other threads:[~2026-10-01  0:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 21:40 [PATCH 0/4] multipath-tools: unmangle WWIDs if necessary mwilck
2026-09-25 21:40 ` [PATCH 1/4] libmultipath: constify functions in wwid.c mwilck
2026-09-30 23:36   ` Benjamin Marzinski
2026-09-25 21:40 ` [PATCH 2/4] libmultipath: unmangle WWIDs if necessary mwilck
2026-10-01  0:04   ` Benjamin Marzinski
2026-09-25 21:40 ` [PATCH 3/4] multipath-tools tests: add test for WWID unmangling mwilck
2026-10-01  0:05   ` Benjamin Marzinski
2026-09-25 21:40 ` [PATCH 4/4] libmultipath: use mmap in lookup_wwid() mwilck
2026-10-01  0:06   ` Benjamin Marzinski [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=ar2kHTTbrVuDrctn@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=mwilck@suse.com \
    --cc=mwilck@suse.de \
    /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.