Re: [PATCH] support polling of /proc/swaps

From: Kay Sievers
Date: Tue Oct 19 2010 - 14:55:07 EST


On Tue, Oct 19, 2010 at 18:11, Jonathan Corbet <corbet@xxxxxxx> wrote:
> 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?

Right, that looks weird. It's the same pointer though, because it's
the first element. I'll correct that.

Thanks a lot for the sharp eyes,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/