aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 5266eec15f6e..5c605b0003a8 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -191,37 +191,6 @@ int sysfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *))
191 return error; 191 return error;
192} 192}
193 193
194/*
195 * Get the name for corresponding element represented by the given sysfs_dirent
196 */
197const unsigned char * sysfs_get_name(struct sysfs_dirent *sd)
198{
199 struct attribute * attr;
200 struct bin_attribute * bin_attr;
201 struct sysfs_symlink * sl;
202
203 BUG_ON(!sd || !sd->s_element);
204
205 switch (sd->s_type) {
206 case SYSFS_DIR:
207 /* Always have a dentry so use that */
208 return sd->s_dentry->d_name.name;
209
210 case SYSFS_KOBJ_ATTR:
211 attr = sd->s_element;
212 return attr->name;
213
214 case SYSFS_KOBJ_BIN_ATTR:
215 bin_attr = sd->s_element;
216 return bin_attr->attr.name;
217
218 case SYSFS_KOBJ_LINK:
219 sl = sd->s_element;
220 return sl->link_name;
221 }
222 return NULL;
223}
224
225static inline void orphan_all_buffers(struct inode *node) 194static inline void orphan_all_buffers(struct inode *node)
226{ 195{
227 struct sysfs_buffer_collection *set; 196 struct sysfs_buffer_collection *set;
@@ -305,7 +274,7 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * name)
305 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { 274 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
306 if (!sd->s_element) 275 if (!sd->s_element)
307 continue; 276 continue;
308 if (!strcmp(sysfs_get_name(sd), name)) { 277 if (!strcmp(sd->s_name, name)) {
309 list_del_init(&sd->s_sibling); 278 list_del_init(&sd->s_sibling);
310 sysfs_drop_dentry(sd, dir); 279 sysfs_drop_dentry(sd, dir);
311 sysfs_put(sd); 280 sysfs_put(sd);