mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: linux-kernel@vger.kernel.org
Subject: new function proc_task_dentry_lookup() based on proc_exe_link() where should it go?
Date: Thu, 9 Sep 2004 22:56:32 +0100	[thread overview]
Message-ID: <20040909215632.GA11785@lkcl.net> (raw)

for the ipt_owner patch to include netfilter support by program name,
i've had to cut/paste / make-use-of some code in fs/proc/base.c.

where _should_ this code go, and is there some functionality that
already exists that is identical to what i have called
proc_task_dentry_lookup().

if so, why isn't it being used by fs/proc/base.c?
[not a trick question, just an honest appraisal]

if not, where _could_ this new function go that's more
appropriate, such that i don't have to rely on CONFIG_FS_PROC
for something totally unrelated [ipt_owner.c of all things!]

l.


	Index: fs/proc/base.c
	===================================================================
	RCS file: /cvsroot/selinux/nsa/linux-2.6/fs/proc/base.c,v
	retrieving revision 1.1.1.9
	diff -u -u -r1.1.1.9 base.c
	--- fs/proc/base.c	18 Jun 2004 19:30:20 -0000	1.1.1.9
	+++ fs/proc/base.c	9 Sep 2004 15:32:32 -0000
	@@ -206,11 +206,12 @@
		return -ENOENT;
	 }
	 
	-static int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount **mnt)
	+extern int proc_task_dentry_lookup(struct task_struct *task, struct dentry **dentry, struct vfsmount **mnt);
	+
	+int proc_task_dentry_lookup(struct task_struct *task, struct dentry **dentry, struct vfsmount **mnt)
	 {
		struct vm_area_struct * vma;
		int result = -ENOENT;
	-	struct task_struct *task = proc_task(inode);
		struct mm_struct * mm = get_task_mm(task);
	 
		if (!mm)
	@@ -233,6 +234,11 @@
		return result;
	 }
	 
	+static int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount **mnt)
	+{
	+	return proc_task_dentry_lookup(proc_task(inode), dentry, mnt);
	+}
	+
	 static int proc_cwd_link(struct inode *inode, struct dentry **dentry, struct vfsmount **mnt)
	 {
		struct fs_struct *fs;
	Index: fs/proc/root.c
	===================================================================
	RCS file: /cvsroot/selinux/nsa/linux-2.6/fs/proc/root.c,v
	retrieving revision 1.1.1.2
	diff -u -u -r1.1.1.2 root.c
	--- fs/proc/root.c	8 Apr 2004 14:13:50 -0000	1.1.1.2
	+++ fs/proc/root.c	9 Sep 2004 15:32:32 -0000
	@@ -147,6 +147,8 @@
		.parent		= &proc_root,
	 };
	 
	+extern int proc_task_dentry_lookup(struct task_struct *task, struct dentry **dentry, struct vfsmount **mnt);
	+
	 #ifdef CONFIG_SYSCTL
	 EXPORT_SYMBOL(proc_sys_root);
	 #endif
	@@ -159,3 +161,4 @@
	 EXPORT_SYMBOL(proc_net);
	 EXPORT_SYMBOL(proc_bus);
	 EXPORT_SYMBOL(proc_root_driver);
	+EXPORT_SYMBOL(proc_task_dentry_lookup);
	Index: include/linux/netfilter_ipv4/ipt_owner.h

-- 
--
Truth, honesty and respect are rare commodities that all spring from
the same well: Love.  If you love yourself and everyone and everything
around you, funnily and coincidentally enough, life gets a lot better.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:lkcl@lkcl.net"> lkcl@lkcl.net </a> <br />


                 reply	other threads:[~2004-09-09 21:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040909215632.GA11785@lkcl.net \
    --to=lkcl@lkcl.net \
    --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

Powered by JetHome