The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@bonn-fries.net>
To: Erik Mouw <J.A.K.Mouw@its.tudelft.nl>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Val Henson <val@nmt.edu>, "Randy.Dunlap" <rddunlap@osdl.org>,
	Laurent <laurent@augias.org>,
	linux-kernel@vger.kernel.org
Subject: Re: read_proc issue
Date: Wed, 27 Feb 2002 04:19:35 +0100	[thread overview]
Message-ID: <E16fucy-0004vi-00@starship.berlin> (raw)
In-Reply-To: <20020227140432.L20918@boardwalk> <E16gBps-0005wa-00@the-village.bc.nu> <20020228000532.GA8858@arthur.ubicom.tudelft.nl>
In-Reply-To: <20020228000532.GA8858@arthur.ubicom.tudelft.nl>

On February 28, 2002 01:05 am, Erik Mouw wrote:
> On Wed, Feb 27, 2002 at 09:42:04PM +0000, Alan Cox wrote:
> > > I've encountered this problem before, too.  What is the "One True Way"
> > > to do this cleanly?  In other words, if you want to do a calculation
> > > once every time someone runs "cat /proc/foo", what is the cleanest way
> > > to do that?  The solution we came up with was to check the file offset
> > > and only do the calculation if offset == 0, which seems pretty
> > > hackish.
> > 
> > Another approach is to do the calculation open and remember it in per
> > fd private data. You can recover that and free it on release. It could
> > even be a buffer holding the actual "content"
> 
> It might also be an idea to export proc_calc_metrics() from
> fs/proc/proc_misc.c because quite a lot of code actually tries to do
> exactly the same.

Look at all the parameters, they're trying to be a struct.  How about
cleaning it up before exporting?

-- 
Daniel

  reply	other threads:[~2002-03-01  2:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-26 18:21 read_proc issue Laurent
2002-02-27 19:33 ` Randy.Dunlap
2002-02-27 21:04   ` Val Henson
2002-02-27 21:42     ` Alan Cox
2002-02-27 21:44       ` Cort Dougan
2002-02-28  0:05       ` Erik Mouw
2002-02-27  3:19         ` Daniel Phillips [this message]
2002-03-01  7:14           ` Erik Mouw
2002-03-01  7:47             ` Alexander Viro
2002-03-01  8:18               ` Laurent
2002-03-01  8:18                 ` Alexander Viro
2002-03-01 19:49               ` Cort Dougan
2002-02-27 23:32     ` Laurent
  -- strict thread matches above, loose matches on Subject: below --
2002-02-27  0:51 Thomas Hood

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=E16fucy-0004vi-00@starship.berlin \
    --to=phillips@bonn-fries.net \
    --cc=J.A.K.Mouw@its.tudelft.nl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=laurent@augias.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rddunlap@osdl.org \
    --cc=val@nmt.edu \
    /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