linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Kprobes /proc entry
Date: Thu, 13 Jan 2005 16:22:03 -0800	[thread overview]
Message-ID: <20050113162203.737e90ac@dxpl.pdx.osdl.net> (raw)
In-Reply-To: 41E70234.50900@gmail.com

The module ref counting should be done by the VFS layer
not the interface. See below:

> - --- ./kernel/kprobes.c	2005-01-13 20:41:11.000000000 +0100
> +++ ./kernel/kprobes.c	2005-01-13 20:39:27.000000000 +0100
> @@ -33,6 +33,9 @@
>  #include <linux/hash.h>
>  #include <linux/init.h>
>  #include <linux/module.h>
> +#include <linux/fs.h>
> +#include <linux/debugfs.h>
> +#include <linux/kallsyms.h>
>  #include <asm/cacheflush.h>
>  #include <asm/errno.h>
>  #include <asm/kdebug.h>
> @@ -131,6 +134,96 @@
>  	unregister_kprobe(&jp->kp);
>  }
> 
> +#ifdef CONFIG_DEBUG_FS
> +int kprobes_open(struct inode *inode, struct file *file)
> +{
> +	try_module_get(THIS_MODULE);
not needed (see below).
> +	return 0;
> +}
> +
> +int kprobes_release(struct inode *inode, struct file *file)
> +{
> +	module_put(THIS_MODULE);
ditto

> +	return 0;
> +}

> +
> +struct dentry *kprobes_dir, *kprobes_list;
> +struct file_operations kprobes_fops = {
> +	.open = kprobes_open,
> +	.read = kprobes_read,
> +	.release = kprobes_release
Add:
	.owner = THIS_MODULE,


      parent reply	other threads:[~2005-01-14  0:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 16:25 [PATCH] Kprobes /proc entry Luca Falavigna
2005-01-10 18:14 ` Greg KH
2005-01-11 21:31   ` Nathan Lynch
2005-01-11 21:34     ` Greg KH
2005-01-12  0:09       ` Luca Falavigna
2005-01-12  6:35         ` Prasanna S Panchamukhi
2005-01-12  9:49           ` Prasanna S Panchamukhi
2005-01-13 23:20       ` Luca Falavigna
2005-01-13 23:34         ` Greg KH
2005-01-17 16:58           ` Luca Falavigna
2005-01-18  6:44             ` Greg KH
2005-01-20 14:13               ` Luca Falavigna
2005-01-14  0:22         ` Stephen Hemminger [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=20050113162203.737e90ac@dxpl.pdx.osdl.net \
    --to=shemminger@osdl.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).