Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196055
b: refs/heads/master
c: 746edb7
h: refs/heads/master
i:
  196053: 1832c0e
  196051: 8067c8e
  196047: 59dba99
v: v3
  • Loading branch information
Eric W. Biederman authored and Greg Kroah-Hartman committed May 21, 2010
1 parent a7d62e7 commit da3a50b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af10ec77b43335ab4e473e4087d85979caf02d65
refs/heads/master: 746edb7ae8a1abdd39be2b28c03aa073183340db
20 changes: 20 additions & 0 deletions trunk/fs/sysfs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,26 @@ int sysfs_create_link_nowarn(struct kobject *kobj, struct kobject *target,
return sysfs_do_create_link(kobj, target, name, 0);
}

/**
* sysfs_delete_link - remove symlink in object's directory.
* @kobj: object we're acting for.
* @targ: object we're pointing to.
* @name: name of the symlink to remove.
*
* Unlike sysfs_remove_link sysfs_delete_link has enough information
* to successfully delete symlinks in tagged directories.
*/
void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
const char *name)
{
const void *ns = NULL;
spin_lock(&sysfs_assoc_lock);
if (targ->sd)
ns = targ->sd->s_ns;
spin_unlock(&sysfs_assoc_lock);
sysfs_hash_and_remove(kobj->sd, ns, name);
}

/**
* sysfs_remove_link - remove symlink in object's directory.
* @kobj: object we're acting for.
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/linux/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ void sysfs_remove_link(struct kobject *kobj, const char *name);
int sysfs_rename_link(struct kobject *kobj, struct kobject *target,
const char *old_name, const char *new_name);

void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
const char *name);

int __must_check sysfs_create_group(struct kobject *kobj,
const struct attribute_group *grp);
int sysfs_update_group(struct kobject *kobj,
Expand Down Expand Up @@ -269,6 +272,11 @@ static inline int sysfs_rename_link(struct kobject *k, struct kobject *t,
return 0;
}

static inline void sysfs_delete_link(struct kobject *k, struct kobject *t,
const char *name)
{
}

static inline int sysfs_create_group(struct kobject *kobj,
const struct attribute_group *grp)
{
Expand Down

0 comments on commit da3a50b

Please sign in to comment.