On Fri, Sep 25, 2026 at 11:40:09PM +0200, [email protected] wrote:
> From: Martin Wilck <[email protected]>
> 
> 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 <[email protected]>
> ---
>  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 via email to