• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/sysfs/

Lines Matching refs:sd

20 	struct sysfs_dirent * sd = dentry->d_fsdata;
22 if (sd) {
23 /* sd->s_dentry is protected with sysfs_lock. This
29 * lookup could have happened updating sd->s_dentry to
33 if (sd->s_dentry == dentry)
34 sd->s_dentry = NULL;
36 sysfs_put(sd);
58 struct sysfs_dirent * sd;
60 sd = kmem_cache_zalloc(sysfs_dir_cachep, GFP_KERNEL);
61 if (!sd)
64 sd->s_ino = sysfs_get_inum();
65 atomic_set(&sd->s_count, 1);
66 atomic_set(&sd->s_event, 1);
67 INIT_LIST_HEAD(&sd->s_children);
68 INIT_LIST_HEAD(&sd->s_sibling);
69 sd->s_element = element;
71 return sd;
75 struct sysfs_dirent *sd)
77 if (sd)
78 list_add(&sd->s_sibling, &parent_sd->s_children);
84 struct sysfs_dirent *sd;
85 sd = __sysfs_new_dirent(element);
86 __sysfs_list_dirent(parent_sd, sd);
87 return sd;
100 struct sysfs_dirent * sd;
102 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
103 if (sd->s_element) {
104 const unsigned char *existing = sysfs_get_name(sd);
119 struct sysfs_dirent * sd;
121 sd = __sysfs_new_dirent(element);
122 if (!sd)
125 sd->s_mode = mode;
126 sd->s_type = type;
127 sd->s_dentry = dentry;
129 dentry->d_fsdata = sysfs_get(sd);
134 return sd;
140 struct sysfs_dirent *sd;
142 sd = __sysfs_make_dirent(dentry, element, mode, type);
143 __sysfs_list_dirent(parent_sd, sd);
145 return sd ? 0 : -ENOMEM;
194 struct sysfs_dirent *sd = (*d)->d_fsdata;
195 if (sd) {
196 list_del_init(&sd->s_sibling);
197 sysfs_put(sd);
246 static int sysfs_attach_attr(struct sysfs_dirent * sd, struct dentry * dentry)
253 if (sd->s_type & SYSFS_KOBJ_BIN_ATTR) {
254 bin_attr = sd->s_element;
257 attr = sd->s_element;
261 dentry->d_fsdata = sysfs_get(sd);
262 /* protect sd->s_dentry against sysfs_d_iput */
264 sd->s_dentry = dentry;
268 sysfs_put(sd);
282 static int sysfs_attach_link(struct sysfs_dirent * sd, struct dentry * dentry)
286 dentry->d_fsdata = sysfs_get(sd);
287 /* protect sd->s_dentry against sysfs_d_iput */
289 sd->s_dentry = dentry;
296 sysfs_put(sd);
305 struct sysfs_dirent * sd;
308 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
309 if (sd->s_type & SYSFS_NOT_PINNED) {
310 const unsigned char * name = sysfs_get_name(sd);
315 if (sd->s_type & SYSFS_KOBJ_LINK)
316 err = sysfs_attach_link(sd, dentry);
318 err = sysfs_attach_attr(sd, dentry);
334 struct sysfs_dirent * sd;
338 sd = d->d_fsdata;
339 list_del_init(&sd->s_sibling);
340 sysfs_put(sd);
360 struct sysfs_dirent * sd, * tmp;
369 list_for_each_entry_safe(sd, tmp, &parent_sd->s_children, s_sibling) {
370 if (!sd->s_element || !(sd->s_type & SYSFS_NOT_PINNED))
372 list_del_init(&sd->s_sibling);
373 sysfs_drop_dentry(sd, dentry);
374 sysfs_put(sd);
427 struct sysfs_dirent *sd, *parent_sd;
432 sd = kobj->dentry->d_fsdata;
435 list_del_init(&sd->s_sibling);
436 list_add(&sd->s_sibling, &parent_sd->s_children);
453 struct sysfs_dirent *new_parent_sd, *sd;
471 sd = kobj->dentry->d_fsdata;
485 list_del_init(&sd->s_sibling);
486 list_add(&sd->s_sibling, &new_parent_sd->s_children);
523 static inline unsigned char dt_type(struct sysfs_dirent *sd)
525 return (sd->s_mode >> 12) & 15;
600 struct sysfs_dirent *sd = dentry->d_fsdata;
606 p = sd->s_children.next;
607 while (n && p != &sd->s_children) {
663 struct sysfs_dirent *sd;
678 sd = __sysfs_make_dirent(shadow, kobj, inode->i_mode, SYSFS_DIR);
679 if (!sd)