From: Al Viro <viro@ZenIV.linux.org.uk>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, Valdis.Kletnieks@vt.edu,
agruen@suse.de, hch@lst.de, hugh.dickins@tiscali.co.uk,
matthew@wil.cx
Subject: Re: [PATCH 2/2] vfs: fix d_path() for unreachable paths
Date: Mon, 21 Sep 2009 15:43:36 +0100 [thread overview]
Message-ID: <20090921144336.GF14381@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20090921143857.GE14381@ZenIV.linux.org.uk>
On Mon, Sep 21, 2009 at 03:38:57PM +0100, Al Viro wrote:
> On Mon, Sep 21, 2009 at 10:10:17AM -0400, Mike Frysinger wrote:
>
> > it works without having to copy & paste the same exact structures over
> > and over. a suggestion as how to do it cleanly without bloating the
> > code is certainly welcome. it doesnt really matter that it's on the
> > stack as the usage is small and d_path() is given the size of the
> > buffer, so it isnt going to overflow.
>
> Umm... Surely, you can put a CPU number + one bit into PDE->data? As in
> proc_create_data("icplb", ....., (void *)(cpu * 2))
> proc_create_data("dcplb", ....., (void *)(cpu * 2 + 1))
> and
> struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
> unsigned long n = (unsigned long) pde->data;
> ...
> cpu = n / 2;
> is_D = n & 1;
PS: as to why it is broken... Consider e.g.
mount --bind /proc/cplbinfo/cpu0 /mnt
cat /mnt/icplb
Or, better yet,
mount -t proc none /mnt/cpu
cat /mnt/cpu/cplbinfo/cpu0/icplb
next prev parent reply other threads:[~2009-09-21 14:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-21 12:48 [PATCH 1/2] vfs: seq_file: add helpers for data filling Miklos Szeredi
2009-09-21 12:51 ` [PATCH 2/2] vfs: fix d_path() for unreachable paths Miklos Szeredi
2009-09-21 14:02 ` Al Viro
2009-09-21 14:10 ` Mike Frysinger
2009-09-21 14:38 ` Al Viro
2009-09-21 14:43 ` Al Viro [this message]
2009-09-21 15:31 ` Mike Frysinger
2009-09-21 15:30 ` Mike Frysinger
2009-09-21 15:30 ` Mike Frysinger
2009-09-23 4:59 ` [PATCH] Blackfin: cplbinfo: drop d_path() hacks Mike Frysinger
2009-09-21 15:03 ` [PATCH 2/2] vfs: fix d_path() for unreachable paths 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=20090921144336.GF14381@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=Valdis.Kletnieks@vt.edu \
--cc=agruen@suse.de \
--cc=akpm@linux-foundation.org \
--cc=hch@lst.de \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=miklos@szeredi.hu \
--cc=vapier.adi@gmail.com \
/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.