Home » Mailing lists » Devel » [PATCH 0/25] Sysfs cleanups & tagged directory support
[PATCH 19/25] sysfs: sysfs_get_dentry add a sb parameter [message #19581 is a reply to message #19580] |
Tue, 07 August 2007 21:29 |
ebiederm
Messages: 1354 Registered: February 2006
|
Senior Member |
|
|
In preparation for multiple mounts of sysfs add a superblock parameter to
sysfs_get_dentry.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
fs/sysfs/dir.c | 12 +++++++-----
fs/sysfs/file.c | 4 ++--
fs/sysfs/sysfs.h | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 94d705a..ac45523 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -805,6 +805,7 @@ out:
/**
* sysfs_get_dentry - get dentry for the given sysfs_dirent
+ * @sb: superblock of the dentry to return
* @sd: sysfs_dirent of interest
*
* Get dentry for @sd. Dentry is looked up if currently not
@@ -817,8 +818,9 @@ out:
*
* RETURNS:
* Pointer to found dentry on success, ERR_PTR() value on error.
+ * NULL if the sysfs dentry does not appear in the specified superblock
*/
-struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd)
+struct dentry *sysfs_get_dentry(struct super_block *sb, struct sysfs_dirent *sd)
{
struct sysfs_dirent *cur;
struct dentry *parent_dentry, *dentry;
@@ -827,7 +829,7 @@ struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd)
*/
dentry = NULL;
cur = sd;
- while (!(dentry = __sysfs_get_dentry(sysfs_sb, cur))) {
+ while (!(dentry = __sysfs_get_dentry(sb, cur))) {
if (cur->s_flags & SYSFS_FLAG_REMOVED) {
dentry = ERR_PTR(-ENOENT);
break;
@@ -868,7 +870,7 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
goto out; /* nothing to rename */
/* get the original dentry */
- old_dentry = sysfs_get_dentry(sd);
+ old_dentry = sysfs_get_dentry(sysfs_sb, sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
goto out;
@@ -937,14 +939,14 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj)
goto out; /* nothing to move */
/* get dentries */
- old_dentry = sysfs_get_dentry(sd);
+ old_dentry = sysfs_get_dentry(sysfs_sb, sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
goto out;
}
old_parent = old_dentry->d_parent;
- new_parent = sysfs_get_dentry(new_parent_sd);
+ new_parent = sysfs_get_dentry(sysfs_sb, new_parent_sd);
if (IS_ERR(new_parent)) {
error = PTR_ERR(new_parent);
goto out;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index fe783ea..f954b9f 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -471,7 +471,7 @@ int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
goto out;
mutex_lock(&sysfs_rename_mutex);
- victim = sysfs_get_dentry(victim_sd);
+ victim = sysfs_get_dentry(sysfs_sb, victim_sd);
mutex_unlock(&sysfs_rename_mutex);
if (IS_ERR(victim)) {
rc = PTR_ERR(victim);
@@ -512,7 +512,7 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode)
goto out;
mutex_lock(&sysfs_rename_mutex);
- victim = sysfs_get_dentry(victim_sd);
+ victim = sysfs_get_dentry(sysfs_sb, victim_sd);
mutex_unlock(&sysfs_rename_mutex);
if (IS_ERR(victim)) {
rc = PTR_ERR(victim);
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 8156ccb..6de7e2b 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -63,7 +63,7 @@ extern struct file_system_type sysfs_fs_type;
void sysfs_grab_supers(void);
void sysfs_release_supers(void);
-extern struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd);
+extern struct dentry *sysfs_get_dentry(struct super_block *sb, struct sysfs_dirent *sd);
extern struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd);
extern void sysfs_put_active(struct sysfs_dirent *sd);
extern struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd);
--
1.5.1.1.181.g2de0
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
|
|
|
|
|
[PATCH 0/25] Sysfs cleanups & tagged directory support
By: ebiederm on Tue, 07 August 2007 21:06
|
|
|
[PATCH 01/25] sysfs: Move all of inode initialization into sysfs_init_inode
By: ebiederm on Tue, 07 August 2007 21:08
|
|
|
[PATCH 02/25] sysfs: Remove sysfs_instantiate
By: ebiederm on Tue, 07 August 2007 21:08
|
|
|
[PATCH 03/25] sysfs: Use kill_anon_super
By: ebiederm on Tue, 07 August 2007 21:10
|
|
|
[PATCH 04/25] sysfs: Make sysfs_mount static
By: ebiederm on Tue, 07 August 2007 21:11
|
|
|
[PATCH 05/25] sysfs: In sysfs_lookup don't open code sysfs_find_dirent
By: ebiederm on Tue, 07 August 2007 21:12
|
|
|
[PATCH 06/25] sysfs: Simplify readdir.
By: ebiederm on Tue, 07 August 2007 21:13
|
|
|
[PATCH 07/25] sysfs: Rewrite sysfs_drop_dentry.
By: ebiederm on Tue, 07 August 2007 21:14
|
|
|
[PATCH 08/25] sysfs: Implement __sysfs_get_dentry
By: ebiederm on Tue, 07 August 2007 21:16
|
|
|
[PATCH 09/25] sysfs: Move sysfs_get_dentry below __sysfs_get_dentry
By: ebiederm on Tue, 07 August 2007 21:17
|
|
|
[PATCH 10/25] sysfs: Rewrite sysfs_get_dentry in terms of __sysfs_get_dentry
By: ebiederm on Tue, 07 August 2007 21:18
|
|
|
[PATCH 11/25] sysfs: Remove s_dentry
By: ebiederm on Tue, 07 August 2007 21:19
|
|
|
[PATCH 12/25] sysfs: Introduce sysfs_rename_mutex
By: ebiederm on Tue, 07 August 2007 21:21
|
|
|
[PATCH 13/25] sysfs: Simply sysfs_get_dentry
By: ebiederm on Tue, 07 August 2007 21:22
|
|
|
[PATCH 14/25] sysfs: Don't use lookup_one_len_kern
By: ebiederm on Tue, 07 August 2007 21:23
|
|
|
[PATCH 15/25] vfs: Remove lookup_one_len_kern
By: ebiederm on Tue, 07 August 2007 21:25
|
|
|
[PATCH 16/25] sysfs: Support for preventing unmounts.
By: ebiederm on Tue, 07 August 2007 21:26
|
|
|
[PATCH 17/25] sysfs: Rewrite rename in terms of sysfs dirents
By: ebiederm on Tue, 07 August 2007 21:27
|
|
|
[PATCH 18/25] sysfs: Rewrite sysfs_move_dir in terms of sysfs dirents
By: ebiederm on Tue, 07 August 2007 21:28
|
|
|
[PATCH 19/25] sysfs: sysfs_get_dentry add a sb parameter
By: ebiederm on Tue, 07 August 2007 21:29
|
|
|
[PATCH 20/25] sysfs: Rename Support multiple superblocks
By: ebiederm on Tue, 07 August 2007 21:31
|
|
|
[PATCH 21/25] sysfs: sysfs_chmod_file handle multiple superblocks
By: ebiederm on Tue, 07 August 2007 21:32
|
|
|
[PATCH 22/25] sysfs: sysfs_uptdate_file handle multiple superblocks
By: ebiederm on Tue, 07 August 2007 21:34
|
|
|
[PATCH 23/25] sysfs: Implement sysfs tagged directory support.
By: ebiederm on Tue, 07 August 2007 21:35
|
|
|
[PATCH 24/25] sysfs: Implement sysfs_delete_link and sysfs_rename_link
By: ebiederm on Tue, 07 August 2007 21:36
|
|
|
[PATCH 25/25] driver core: Implement tagged directory support for device classes.
By: ebiederm on Tue, 07 August 2007 21:36
|
|
|
Re: alternative approached at tagged nodes
|
|
|
Re: [PATCH 22/25] sysfs: sysfs_uptdate_file handle multiple superblocks
|
|
|
Re: [PATCH 21/25] sysfs: sysfs_chmod_file handle multiple superblocks
|
|
|
Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
By: ebiederm on Wed, 08 August 2007 15:45
|
|
|
Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
|
|
|
Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
By: ebiederm on Wed, 08 August 2007 16:35
|
|
|
Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
|
|
|
Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
By: ebiederm on Wed, 08 August 2007 16:55
|
|
|
Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
|
|
|
Re: [PATCH 19/25] sysfs: sysfs_get_dentry add a sb parameter
By: ebiederm on Wed, 08 August 2007 15:34
|
|
|
Re: [PATCH 19/25] sysfs: sysfs_get_dentry add a sb parameter
|
|
|
Re: [PATCH 18/25] sysfs: Rewrite sysfs_move_dir in terms of sysfs dirents
|
|
|
Re: [PATCH 17/25] sysfs: Rewrite rename in terms of sysfs dirents
By: ebiederm on Wed, 08 August 2007 15:32
|
|
|
Re: [PATCH 17/25] sysfs: Rewrite rename in terms of sysfs dirents
|
|
|
Re: [PATCH 15/25] vfs: Remove lookup_one_len_kern
|
|
|
Re: [PATCH 14/25] sysfs: Don't use lookup_one_len_kern
By: ebiederm on Wed, 08 August 2007 15:26
|
|
|
Re: [PATCH 14/25] sysfs: Don't use lookup_one_len_kern
|
|
|
Re: [PATCH 14/25] sysfs: Don't use lookup_one_len_kern
|
|
|
Re: [PATCH 13/25] sysfs: Simply sysfs_get_dentry
|
|
|
Re: [PATCH 12/25] sysfs: Introduce sysfs_rename_mutex
By: ebiederm on Wed, 08 August 2007 08:28
|
|
|
Re: [PATCH 12/25] sysfs: Introduce sysfs_rename_mutex
|
|
|
Re: [PATCH 12/25] sysfs: Introduce sysfs_rename_mutex
|
|
|
Re: [PATCH 11/25] sysfs: Remove s_dentry
|
|
|
Re: [PATCH 10/25] sysfs: Rewrite sysfs_get_dentry in terms of __sysfs_get_dentry
|
|
|
Re: [PATCH 09/25] sysfs: Move sysfs_get_dentry below __sysfs_get_dentry
|
|
|
Re: [PATCH 08/25] sysfs: Implement __sysfs_get_dentry
|
|
|
Re: [PATCH 07/25] sysfs: Rewrite sysfs_drop_dentry.
|
|
|
Re: [PATCH 06/25] sysfs: Simplify readdir.
|
|
|
Re: [PATCH 05/25] sysfs: In sysfs_lookup don't open code sysfs_find_dirent
|
|
|
Re: [PATCH 04/25] sysfs: Make sysfs_mount static
|
|
|
Re: [PATCH 03/25] sysfs: Use kill_anon_super
|
|
|
Re: [PATCH 02/25] sysfs: Remove sysfs_instantiate
|
|
|
Re: [PATCH 01/25] sysfs: Move all of inode initialization into sysfs_init_inode
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
By: ebiederm on Wed, 08 August 2007 07:47
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
By: ebiederm on Wed, 08 August 2007 07:57
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
By: ebiederm on Wed, 08 August 2007 15:08
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
By: ebiederm on Wed, 08 August 2007 15:53
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
By: ebiederm on Wed, 08 August 2007 16:37
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
|
|
Re: [PATCH 0/25] Sysfs cleanups & tagged directory support
|
Goto Forum:
Current Time: Tue Oct 15 13:29:23 GMT 2024
Total time taken to generate the page: 0.04883 seconds
|