lkml.org 
[lkml]   [2010]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] support polling of /proc/swaps
> 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


\
 
 \ /
  Last update: 2010-10-19 18:15    [W:0.073 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site