netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Greg Kroah-Hartman <gregkh@suse.de>, Greg KH <greg@kroah.com>
Cc: Tejun Heo <htejun@gmail.com>,
	Linux Containers <containers@lists.osdl.org>,
	<netdev@vger.kernel.org>,
	cornelia.huck@de.ibm.com, stern@rowland.harvard.edu,
	kay.sievers@vrfy.org, <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	David Miller <davem@davemloft.net>
Subject: [PATCH 01/10] sysfs: Make sysfs_mount static again.
Date: Sat, 01 Dec 2007 02:12:27 -0700	[thread overview]
Message-ID: <m11wa693t0.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <m163zi9425.fsf@ebiederm.dsl.xmission.com> (Eric W. Biederman's message of "Sat, 01 Dec 2007 02:06:58 -0700")


In preparation for supporting multiple mounts of sysfs I need to
remove all assumptions that we have a single mount of sysfs.  So this
patch modifies sysfs_open_file to use the vfsmount from the struct
file instead of fibbing and using the global vfsmount.

We get a little more noise this way but we should continue to get the
useful part of the debugging information.

This was the reason I made sysfs_mount static earlier.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 fs/sysfs/file.c  |    2 +-
 fs/sysfs/mount.c |    2 +-
 fs/sysfs/sysfs.h |    1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 87e4a0e..ad13151 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -330,7 +330,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
 	int error = -EACCES;
 	char *p;
 
-	p = d_path(file->f_dentry, sysfs_mount, last_sysfs_file,
+	p = d_path(file->f_dentry, file->f_vfsmnt, last_sysfs_file,
 		   sizeof(last_sysfs_file));
 	if (p)
 		memmove(last_sysfs_file, p, strlen(p) + 1);
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index a3410d6..7416826 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -22,7 +22,7 @@
 /* Random magic number */
 #define SYSFS_MAGIC 0x62656572
 
-struct vfsmount *sysfs_mount;
+static struct vfsmount *sysfs_mount;
 struct super_block * sysfs_sb = NULL;
 struct kmem_cache *sysfs_dir_cachep;
 
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 52aaa8c..ff17f8d 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -91,7 +91,6 @@ struct sysfs_addrm_cxt {
 extern struct sysfs_dirent sysfs_root;
 extern struct super_block *sysfs_sb;
 extern struct kmem_cache *sysfs_dir_cachep;
-extern struct vfsmount *sysfs_mount;
 
 /*
  * dir.c
-- 
1.5.3.rc6.17.g1911


  reply	other threads:[~2007-12-01  9:14 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-01  9:06 [PATCH 0/10] sysfs network namespace support Eric W. Biederman
2007-12-01  9:12 ` Eric W. Biederman [this message]
2007-12-01  9:13   ` [PATCH 02/10] sysfs: Support for preventing unmounts Eric W. Biederman
2007-12-01  9:16     ` [PATCH 03/10] sysfs: sysfs_get_dentry add a sb parameter Eric W. Biederman
2007-12-01  9:18       ` [PATCH 04/10] sysfs: Implement __sysfs_get_dentry Eric W. Biederman
2007-12-01  9:23         ` [PATCH 05/10] sysfs: Rename Support multiple superblocks Eric W. Biederman
2007-12-01  9:25           ` [PATCH 06/10] sysfs: sysfs_chmod_file handle " Eric W. Biederman
2007-12-01  9:28             ` [PATCH 07/10] sysfs: Implement sysfs tagged directory support Eric W. Biederman
2007-12-01  9:30               ` [PATCH 08/10] sysfs: Implement sysfs_delete_link and sysfs_rename_link Eric W. Biederman
2007-12-01  9:33                 ` [PATCH 09/10] driver core: Implement tagged directory support for device classes Eric W. Biederman
2007-12-01  9:35                   ` [PATCH 10/10] net: Enable tagging for net_class directories in sysfs Eric W. Biederman
2007-12-01 13:10 ` namespace support requires network modules to say "GPL" Mark Lord
2007-12-01 13:13   ` Mark Lord
2007-12-01 19:17   ` Stephen Hemminger
2007-12-01 19:23     ` Alan Cox
     [not found]       ` <20071201192341.6750fbdb-v58gJUvfdfWUJIigds3554dd74u8MsAO@public.gmane.org>
2007-12-01 19:38         ` Stephen Hemminger
2007-12-01 19:45           ` Alan Cox
2007-12-01 20:13           ` Eric W. Biederman
     [not found]             ` <m13aum5g1x.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-12-01 20:21               ` Mark Lord
2007-12-01 20:29                 ` Arjan van de Ven
2007-12-01 22:12                   ` Mark Lord
2007-12-01 23:13                     ` Eric W. Biederman
2007-12-01 23:24                       ` Jiri Slaby
2007-12-02  1:14                         ` Eric W. Biederman
2007-12-01 23:51                       ` Mark Lord
2007-12-02  1:08                         ` Eric W. Biederman
2007-12-01 20:52                 ` Eric W. Biederman
2007-12-01 22:13                 ` Mark Lord
2007-12-03  0:02       ` David Schwartz
2007-12-03  0:14         ` Alan Cox
2007-12-01 19:54     ` Eric W. Biederman
2007-12-02  0:30     ` Stephen Hemminger
2007-12-02  2:02       ` Eric W. Biederman
2007-12-02  3:34       ` Mark Lord
2007-12-02  4:23         ` Stephen Hemminger
2007-12-02 19:28           ` Ben Greear
2007-12-02 20:03             ` Patrick McHardy
2007-12-02 20:43               ` Adrian Bunk
2007-12-02 21:59                 ` Patrick McHardy
2007-12-03  1:14                   ` Adrian Bunk
2007-12-03  8:33                   ` Denis V. Lunev
2007-12-03 17:35               ` Eric W. Biederman
2007-12-03 18:19                 ` Ben Greear
2007-12-03 18:57                   ` Daniel Lezcano
2007-12-04 15:19                     ` Daniel Lezcano
2007-12-04 18:03                     ` Eric W. Biederman
2007-12-04 18:44                       ` Ben Greear
2007-12-04 19:17                         ` Eric W. Biederman
2007-12-04 19:35                           ` Ben Greear
2007-12-04 20:09                             ` Eric W. Biederman
2007-12-05  6:14                           ` David Miller
2007-12-05  6:01                       ` David Miller
2007-12-04 17:59                   ` Eric W. Biederman
2007-12-04 18:57                     ` Ben Greear
2007-12-04 20:01                       ` Eric W. Biederman
2007-12-05  6:07                       ` David Miller
2007-12-03  8:24         ` Romano Giannetti
2007-12-03 15:34           ` Arjan van de Ven
2007-12-03 18:03           ` Eric W. Biederman
2007-12-03 18:13             ` David Miller
2007-12-02 13:51       ` Alan Cox
2007-12-02 19:56         ` Valdis.Kletnieks
2007-12-21  3:07 ` [PATCH 0/10] sysfs network namespace support Greg KH
2007-12-21 13:04   ` Eric W. Biederman

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=m11wa693t0.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.osdl.org \
    --cc=cornelia.huck@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=htejun@gmail.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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).