aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-29 16:40:27 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-29 16:40:27 -0400
commitc1b054d03f5b31c33eaa0b267c629b118eaf3790 (patch)
tree9333907ca767be24fcb3667877242976c3e3c8dd /fs/sysfs/inode.c
parent559fb51ba7e66fe298b8355fabde1275b7def35f (diff)
parentbf4e70e54cf31dcca48d279c7f7e71328eebe749 (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 565cac1d4200..970a33f03299 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -85,7 +85,7 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr)
85 85
86 if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) 86 if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
87 mode &= ~S_ISGID; 87 mode &= ~S_ISGID;
88 sd_iattr->ia_mode = mode; 88 sd_iattr->ia_mode = sd->s_mode = mode;
89 } 89 }
90 90
91 return error; 91 return error;
@@ -166,16 +166,6 @@ int sysfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *))
166 return error; 166 return error;
167} 167}
168 168
169struct dentry * sysfs_get_dentry(struct dentry * parent, const char * name)
170{
171 struct qstr qstr;
172
173 qstr.name = name;
174 qstr.len = strlen(name);
175 qstr.hash = full_name_hash(name,qstr.len);
176 return lookup_hash(&qstr,parent);
177}
178
179/* 169/*
180 * Get the name for corresponding element represented by the given sysfs_dirent 170 * Get the name for corresponding element represented by the given sysfs_dirent
181 */ 171 */
@@ -238,6 +228,10 @@ void sysfs_hash_and_remove(struct dentry * dir, const char * name)
238 struct sysfs_dirent * sd; 228 struct sysfs_dirent * sd;
239 struct sysfs_dirent * parent_sd = dir->d_fsdata; 229 struct sysfs_dirent * parent_sd = dir->d_fsdata;
240 230
231 if (dir->d_inode == NULL)
232 /* no inode means this hasn't been made visible yet */
233 return;
234
241 down(&dir->d_inode->i_sem); 235 down(&dir->d_inode->i_sem);
242 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { 236 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
243 if (!sd->s_element) 237 if (!sd->s_element)