Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
e956d3ab
Commit
e956d3ab
authored
Jul 03, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] kobject: add kobject_rename()
Based on a patch written by Dan Aloni <da-x@gmx.net>
parent
f91c01ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
include/linux/kobject.h
include/linux/kobject.h
+2
-0
lib/kobject.c
lib/kobject.c
+15
-0
No files found.
include/linux/kobject.h
View file @
e956d3ab
...
...
@@ -39,6 +39,8 @@ extern void kobject_cleanup(struct kobject *);
extern
int
kobject_add
(
struct
kobject
*
);
extern
void
kobject_del
(
struct
kobject
*
);
extern
void
kobject_rename
(
struct
kobject
*
,
char
*
new_name
);
extern
int
kobject_register
(
struct
kobject
*
);
extern
void
kobject_unregister
(
struct
kobject
*
);
...
...
lib/kobject.c
View file @
e956d3ab
...
...
@@ -313,6 +313,21 @@ int kobject_register(struct kobject * kobj)
return
error
;
}
/**
* kobject_rename - change the name of an object
* @kobj: object in question.
* @new_name: object's new name
*/
void
kobject_rename
(
struct
kobject
*
kobj
,
char
*
new_name
)
{
kobj
=
kobject_get
(
kobj
);
if
(
!
kobj
)
return
;
sysfs_rename_dir
(
kobj
,
new_name
);
kobject_put
(
kobj
);
}
/**
* kobject_del - unlink kobject from hierarchy.
* @kobj: object.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment