Subject: Re: [patch 1/2] proc_fops: convert drivers/isdn/ to seq_file

From: Tilman Schmidt <[email-masked]>
Date: Wed, 23 Dec 2009 13:30:25 +0100

Am 22.12.2009 01:25 schrieb [email-masked]:
> From: Alexey Dobriyan <[email-masked]>
> 
> Convert code away from ->read_proc/->write_proc interfaces.  Switch to
> proc_create()/proc_create_data() which make addition of proc entries
> reliable wrt NULL ->proc_fops, NULL ->data and so on.

Nice work, certainly an overall win.

> --- a/Documentation/isdn/INTERFACE.CAPI~proc_fops-convert-drivers-isdn-to-seq_file
> +++ a/Documentation/isdn/INTERFACE.CAPI
> @@ -149,8 +149,8 @@ char *(*procinfo)(struct capi_ctr *ctrlr
>  	pointer to a callback function returning the entry for the device in
>  	the CAPI controller info table, /proc/capi/controller
>  
> -read_proc_t *ctr_read_proc
> -	pointer to the read_proc callback function for the device's proc file
> +const struct file_operations *proc_fops
> +	pointers to callback functions for the device's proc file
>  	system entry, /proc/capi/controllers/<n>; will be called with a
>  	pointer to the device's capi_ctr structure as the last (data) argument
>  

As already noted in my mail dated 28.11.2009 13:26, the result of this is
incorrect.

The new proc_fops callback functions do *not* receive the capi_ctr pointer
as an argument. Instead, they must now retrieve it starting from their file
pointer argument, via PDE(file)->data which will contain a pointer to a
seq_file structure. The private field of that structure will then contain
the required capi_ctr pointer.

So it's not enough to just replace "pointer" by "pointers" here. The second
half of the paragraph needs to be adapted, too.

Thanks,
Tilman

-- 
Tilman Schmidt                    E-Mail: [email-masked]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)