diff options
| author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-27 08:30:07 -0400 |
|---|---|---|
| committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-27 08:30:07 -0400 |
| commit | efda9452046bdd707b23a85b7846ec33548f84f1 (patch) | |
| tree | f08c915049ea1829ba115cd41a0ba28ddf184e07 /fs/sysfs | |
| parent | b01f2cc1c37ac3d5ca313c90370a586dffe5aca9 (diff) | |
| parent | 36676bcbf9f6bcbea9d06e67ee8d04eacde54952 (diff) | |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'fs/sysfs')
| -rw-r--r-- | fs/sysfs/inode.c | 4 | ||||
| -rw-r--r-- | fs/sysfs/symlink.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index d727dc960634..970a33f03299 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
| @@ -228,6 +228,10 @@ void sysfs_hash_and_remove(struct dentry * dir, const char * name) | |||
| 228 | struct sysfs_dirent * sd; | 228 | struct sysfs_dirent * sd; |
| 229 | struct sysfs_dirent * parent_sd = dir->d_fsdata; | 229 | struct sysfs_dirent * parent_sd = dir->d_fsdata; |
| 230 | 230 | ||
| 231 | if (dir->d_inode == NULL) | ||
| 232 | /* no inode means this hasn't been made visible yet */ | ||
| 233 | return; | ||
| 234 | |||
| 231 | down(&dir->d_inode->i_sem); | 235 | down(&dir->d_inode->i_sem); |
| 232 | list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { | 236 | list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { |
| 233 | if (!sd->s_element) | 237 | if (!sd->s_element) |
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index fae57c83a722..de402fa915f2 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
| @@ -151,17 +151,17 @@ static int sysfs_getlink(struct dentry *dentry, char * path) | |||
| 151 | 151 | ||
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | static int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 154 | static void *sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
| 155 | { | 155 | { |
| 156 | int error = -ENOMEM; | 156 | int error = -ENOMEM; |
| 157 | unsigned long page = get_zeroed_page(GFP_KERNEL); | 157 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
| 158 | if (page) | 158 | if (page) |
| 159 | error = sysfs_getlink(dentry, (char *) page); | 159 | error = sysfs_getlink(dentry, (char *) page); |
| 160 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); | 160 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); |
| 161 | return 0; | 161 | return NULL; |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd) | 164 | static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
| 165 | { | 165 | { |
| 166 | char *page = nd_get_link(nd); | 166 | char *page = nd_get_link(nd); |
| 167 | if (!IS_ERR(page)) | 167 | if (!IS_ERR(page)) |
