linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, Greg KH <greg@kroah.com>
Subject: Re: [PATCH] support polling of /proc/swaps
Date: Tue, 19 Oct 2010 10:11:58 -0600	[thread overview]
Message-ID: <20101019101158.29e8cd0f@bike.lwn.net> (raw)
In-Reply-To: <1287479956.1729.1.camel@yio.site>

> From: Kay Sievers <kay.sievers@vrfy.org>
> Subject: support polling of /proc/swaps
> 
> System management wants to subscribe to changes in swap
> configuration. Make /proc/swaps pollable like /proc/mounts.

Please forgive me...I'm probably undercaffeinated and even dumber than
usual, but...

Here we have this:

> +static unsigned swaps_poll(struct file *file, poll_table *wait)
> +{
> +	struct proc_swaps *s = file->private_data;

But here I see:

>  static int swaps_open(struct inode *inode, struct file *file)
>  {
> -	return seq_open(file, &swaps_op);
> +	struct proc_swaps *s;
> +	int ret;
> +
> +	s = kmalloc(sizeof(struct proc_swaps), GFP_KERNEL);
> +	if (!s)
> +		return -ENOMEM;
> +
> +	file->private_data = &s->seq;

It sure looks to me like private_data is a struct seq_file pointer, not a
struct proc_swaps pointer.  What am I missing?

Thanks,

jon

  parent reply	other threads:[~2010-10-19 16:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19  9:19 [PATCH] support polling of /proc/swaps Kay Sievers
2010-10-19 11:09 ` Peter Zijlstra
2010-10-19 16:11 ` Jonathan Corbet [this message]
2010-10-19 18:54   ` Kay Sievers
2010-10-19 22:31 ` Andrew Morton
2010-10-19 23:25   ` Kay Sievers
2010-10-19 23:38     ` Andrew Morton
2010-11-15  3:44     ` Neil Brown
2010-11-16 15:56       ` Kay Sievers

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=20101019101158.29e8cd0f@bike.lwn.net \
    --to=corbet@lwn.net \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@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).