mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Firstname Lastname <skb632@yahoo.com>, linux-kernel@vger.kernel.org
Subject: Re: targets of function pointer invocations
Date: Tue, 02 Sep 2008 17:53:23 -0700	[thread overview]
Message-ID: <48BDE003.1090605@goop.org> (raw)
In-Reply-To: <20080902174224.3ffb9966.randy.dunlap@oracle.com>

Randy Dunlap wrote:
> On Sat, 30 Aug 2008 00:12:12 -0700 (PDT) Firstname Lastname wrote:
>
>   
>> Hi all,
>>
>> The lines 522-523 in function do_acct_process in file kernel/acct.c in version 2.6.26.3 are:
>>
>>  file->f_op->write(file, (char *)&ac,sizeof(acct_t), &file->f_pos);
>>
>> What are the full set of targets of this function pointer invocation and how can one be sure, by examining the code, that this is in fact the complete set?
>>     
>
> If I understand your question, you want to know what are the ->write()
> function parameters and how does one determine them?
>
> 'file' is struct file, found in include/linux/fs.h.
> 'f_op' is struct file_operations, in the same file.
> 'write' is defined in struct file_operations as:
>
> 	ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
>
> 4 typed parameters, returning ssize_t.
>
> Is that what you meant?
>   

Actually, I think OP is asking what's the complete set of functions
->write can point to.  You can look for all the in-tree assignments to
f_ops (or all the struct file_ops) to get the in-kernel estimate.  But
any out of tree module could also install file_ops.write, so you can't
be exhaustive.

    J

      reply	other threads:[~2008-09-03  0:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-30  7:12 Firstname Lastname
2008-09-03  0:42 ` Randy Dunlap
2008-09-03  0:53   ` Jeremy Fitzhardinge [this message]

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=48BDE003.1090605@goop.org \
    --to=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=skb632@yahoo.com \
    /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

Powered by JetHome