public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org, linux-man <linux-man@vger.kernel.org>,
	Alejandro Colomar <alx@kernel.org>,
	Linux API <linux-api@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org, Karel Zak <kzak@redhat.com>,
	Ian Kent <raven@themaw.net>, David Howells <dhowells@redhat.com>,
	Christian Brauner <christian@brauner.io>,
	Amir Goldstein <amir73il@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: proposed libc interface and man page for statmount(2)
Date: Mon, 20 Nov 2023 13:34:56 +0100	[thread overview]
Message-ID: <ZVtScPlr-bkXeHPz@maszat.piliscsaba.szeredi.hu> (raw)
In-Reply-To: <878r6soc13.fsf@oldenburg.str.redhat.com>

On Mon, Nov 20, 2023 at 01:16:24PM +0100, Florian Weimer wrote:
> Is the ID something specific to the VFS layer itself, or does it come
> from file systems?

It comes from the VFS.


> POSIX has a seekdir/telldir interface like that, I don't think file
> system authors like it.  Some have added dedicated data structures for
> it to implement somewhat predictable behavior in the face of concurrent
> directory modification.  Would this interface suffer from similar
> issues?

The same issue was solved for /proc/$$/mountinfo using cursors.

This patchset removes the need for cursors, since the new unique mount ID can be
used to locate the current position without having to worry about deleted and
added mounts.

OTOH I agree that seekdir/telldir are horrible and it's probably best to at
least hide the seekability behind a stateful API:

	struct lm *lm = listmount_open(mnt_id, flags)
	do {
		num = listmount(lm, buf, bufsize);
		for (i = 0; i < num; i++) {
			/* process buf[i] */
		}
	} while (num > 0);
	listmount_close(lm);

Whether doing that in libc or in the kernel is debatable.  I don't think the
kernel API needs to be stateful, but it may allow more flexibility in the
future.  I don't know.

Thanks,
Miklos

  reply	other threads:[~2023-11-20 12:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 15:08 Miklos Szeredi
2023-11-16 20:12 ` Adhemerval Zanella Netto
2023-11-16 20:36 ` Florian Weimer
2023-11-16 21:01   ` Miklos Szeredi
2023-11-17 14:22     ` Miklos Szeredi
2023-11-17 14:47     ` Florian Weimer
2023-11-17 15:13       ` Miklos Szeredi
2023-11-17 15:50         ` Miklos Szeredi
2023-11-20 11:55           ` Miklos Szeredi
2023-11-20 12:16             ` Florian Weimer
2023-11-20 12:34               ` Miklos Szeredi [this message]
2023-11-20 23:56                 ` Ian Kent
2023-11-21  0:58                   ` Ian Kent
2023-11-21  1:12                     ` Ian Kent
2023-11-21  1:33                       ` Ian Kent
2023-11-21 19:42                         ` Miklos Szeredi
2023-11-21 20:42                           ` Zack Weinberg
2023-11-21 23:28                             ` Ian Kent
2023-11-22 16:18                               ` Zack Weinberg
2023-11-21 23:07                           ` Ian Kent
2023-11-22 10:18                           ` Christian Brauner
2023-11-20 15:38             ` Christian Brauner
2023-11-20 15:30         ` Christian Brauner

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=ZVtScPlr-bkXeHPz@maszat.piliscsaba.szeredi.hu \
    --to=miklos@szeredi.hu \
    --cc=alx@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=arnd@arndb.de \
    --cc=christian@brauner.io \
    --cc=dhowells@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=kzak@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=raven@themaw.net \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).