util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Ian Kent <raven@themaw.net>
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH 1/2] libmount: use autofs mount hint to ignore autofs mount entries
Date: Wed, 23 Nov 2022 10:56:36 +0100	[thread overview]
Message-ID: <20221123095636.gmmnayyvssyzgccu@ws.net.home> (raw)
In-Reply-To: <166856404555.472741.8761384857533986022.stgit@donald.themaw.net>

On Wed, Nov 16, 2022 at 10:00:45AM +0800, Ian Kent wrote:
> diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
> index 75f8e406b..293f0a8ed 100644
> --- a/libmount/src/tab_parse.c
> +++ b/libmount/src/tab_parse.c
> @@ -762,6 +762,14 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
>  		if (rc == 0 && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data))
>  			rc = 1;	/* filtered out by callback... */
>  
> +		if (mnt_table_ignore_autofs(tb)) {

 if (rc == 0 && mnt_table_ignore_autofs(tb)) {

Don't waste time if already ignored or in case of error :-)

> +/*
> + * mnt_table_enable_ignore_autofs:
> + * @tb: table
> + *
> + * Enable ignore autofs mount table entries on reading.
> + */
> +int mnt_table_enable_ignore_autofs(struct libmnt_table *tb)
> +{
> +	if (!tb)
> +		return -EINVAL;
> +	tb->ignore_autofs = 1;
> +	return 0;
> +}


The library usually uses the same function to enable as well as disable:

int mnt_table_enable_ignore_autofs(struct libmnt_table *tb, int ignore)
{
    if (tb)
        return -EINVAL;
    tb->ignore_autofs = ignore ? 1 : 0;
}

and mnt_context_enable_ignore_autofs() is the same.


    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


  reply	other threads:[~2022-11-23 10:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  2:00 [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries Ian Kent
2022-11-16  2:00 ` [PATCH 1/2] libmount: use autofs mount hint to ignore autofs mount entries Ian Kent
2022-11-23  9:56   ` Karel Zak [this message]
2022-11-23 11:00     ` Ian Kent
2022-11-23 11:08       ` Karel Zak
2022-11-16  2:00 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent
2022-11-23  9:51 ` [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries Karel Zak
2022-11-23 10:55   ` Ian Kent
2022-11-23 11:17     ` Karel Zak

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=20221123095636.gmmnayyvssyzgccu@ws.net.home \
    --to=kzak@redhat.com \
    --cc=raven@themaw.net \
    --cc=util-linux@vger.kernel.org \
    /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).