LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: akpm@linux-foundation.org, linuxram@us.ibm.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 6/7] vfs: mountinfo: add /proc/<pid>/mountinfo
Date: Thu, 27 Mar 2008 22:36:24 +0000	[thread overview]
Message-ID: <20080327223624.GZ10722@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20080327122359.210920974@szeredi.hu>

On Thu, Mar 27, 2008 at 01:06:25PM +0100, Miklos Szeredi wrote:
> +36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue

Works for me...

> -static int show_vfsmnt(struct seq_file *m, void *v)
> +struct proc_fs_info {

struct flag_name would be better; will do on merge.

> +static void show_type(struct seq_file *m, struct super_block *sb)
> +{
> +	mangle(m, sb->s_type->name);

BTW, do we really want to bother with quoting?  Anyway, that can live
for now...

> +static int show_mountinfo(struct seq_file *m, void *v)
> +{
> +	struct proc_mounts *p = m->private;
> +	size_t count_save = m->count;

> +		/*
> +		 * Mountpoint is outside root, rewind seq_file. Ugly,
> +		 * but necessary for race-free detection of unreachable
> +		 * mountpoints.
> +		 */
> +		m->count = count_save;
> +		return 0;
> +	}

You know, _if_ we want to go that way, let's do it right; all callers
of ->show() are in seq_file.c and all of them know the previous value
of m->count.  So let's define SEQ_SKIP as 1 and teach these 3 callers
to handle it.  And make this sucker (and anything else that might want
the same kind of things) return SEQ_SKIP instead of playing with m->count
directly.

Again, will do on merge...

  reply	other threads:[~2008-03-27 22:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27 12:06 [patch 0/7] vfs: mountinfo (v4) Miklos Szeredi
2008-03-27 12:06 ` [patch 1/7] vfs: mountinfo: add dentry_path() Miklos Szeredi
2008-03-27 12:06 ` [patch 2/7] vfs: mountinfo: add seq_file_root() Miklos Szeredi
2008-03-27 12:06 ` [patch 3/7] vfs: mountinfo: add mount ID Miklos Szeredi
2008-03-27 22:13   ` Al Viro
2008-03-27 12:06 ` [patch 4/7] vfs: mountinfo: add mount peer group ID Miklos Szeredi
2008-03-27 12:06 ` [patch 5/7] vfs: mountinfo: allow using process root Miklos Szeredi
2008-03-28  2:08   ` Al Viro
2008-03-28  8:59     ` Miklos Szeredi
2008-03-27 12:06 ` [patch 6/7] vfs: mountinfo: add /proc/<pid>/mountinfo Miklos Szeredi
2008-03-27 22:36   ` Al Viro [this message]
2008-03-28  8:48     ` Miklos Szeredi
2008-03-27 12:06 ` [patch 7/7] vfs: mountinfo: show dominating group id Miklos Szeredi
2008-03-27 22:42   ` Al Viro
2008-03-28  8:52     ` Miklos Szeredi
2008-03-30 18:51   ` Ram Pai
  -- strict thread matches above, loose matches on Subject: below --
2008-03-26 21:11 [patch 0/7] vfs: mountinfo (v3) Miklos Szeredi
2008-03-26 21:11 ` [patch 6/7] vfs: mountinfo: add /proc/<pid>/mountinfo Miklos Szeredi
2008-03-26 22:44   ` Al Viro
2008-03-27  8:33     ` Miklos Szeredi

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=20080327223624.GZ10722@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=miklos@szeredi.hu \
    --subject='Re: [patch 6/7] vfs: mountinfo: add /proc/<pid>/mountinfo' \
    /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

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).