All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: adobriyan@gmail.com
Cc: akpm@linux-foundation.org, isdn@linux-pingi.de, netdev@vger.kernel.org
Subject: Re: [patch 1/2] proc_fops: convert drivers/isdn/ to seq_file
Date: Wed, 23 Dec 2009 13:30:25 +0100	[thread overview]
Message-ID: <4B320D61.4070403@imap.cc> (raw)
In-Reply-To: <200912220025.nBM0PVBC005140@imap1.linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1816 bytes --]

Am 22.12.2009 01:25 schrieb akpm@linux-foundation.org:
> From: Alexey Dobriyan <adobriyan@gmail.com>
> 
> 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: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2009-12-23 12:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-22  0:25 [patch 1/2] proc_fops: convert drivers/isdn/ to seq_file akpm
2009-12-23 12:30 ` Tilman Schmidt [this message]
2010-01-05 21:19   ` Alexey Dobriyan
2010-01-10 18:42     ` Tilman Schmidt
2010-01-10 21:29       ` David Miller
2010-01-10 23:33         ` Karsten Keil
2010-01-14  1:37         ` [ISDN] " Karsten Keil
2010-01-14  1:53           ` David Miller
2010-01-14  2:39             ` Karsten Keil
2010-01-14  2:43               ` David Miller
2010-01-14  4:29           ` David Miller
2010-01-14 11:01             ` David Miller
2010-01-04  5:26 ` [patch 1/2] " David Miller

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=4B320D61.4070403@imap.cc \
    --to=tilman@imap.cc \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=isdn@linux-pingi.de \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.