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
Kirill Smelkov
linux
Commits
f91c01ac
Commit
f91c01ac
authored
Jul 03, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sysfs: add sysfs_rename_dir()
Based on a patch written by Dan Aloni <da-x@gmx.net>
parent
04798180
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
fs/sysfs/dir.c
fs/sysfs/dir.c
+22
-0
include/linux/sysfs.h
include/linux/sysfs.h
+3
-0
No files found.
fs/sysfs/dir.c
View file @
f91c01ac
...
@@ -121,7 +121,29 @@ void sysfs_remove_dir(struct kobject * kobj)
...
@@ -121,7 +121,29 @@ void sysfs_remove_dir(struct kobject * kobj)
dput
(
parent
);
dput
(
parent
);
}
}
void
sysfs_rename_dir
(
struct
kobject
*
kobj
,
char
*
new_name
)
{
struct
dentry
*
new_dentry
,
*
parent
;
if
(
!
strcmp
(
kobj
->
name
,
new_name
))
return
;
if
(
!
kobj
->
parent
)
return
;
parent
=
kobj
->
parent
->
dentry
;
down
(
&
parent
->
d_inode
->
i_sem
);
new_dentry
=
sysfs_get_dentry
(
parent
,
new_name
);
d_move
(
kobj
->
dentry
,
new_dentry
);
strlcpy
(
kobj
->
name
,
new_name
,
KOBJ_NAME_LEN
);
up
(
&
parent
->
d_inode
->
i_sem
);
}
EXPORT_SYMBOL
(
sysfs_create_dir
);
EXPORT_SYMBOL
(
sysfs_create_dir
);
EXPORT_SYMBOL
(
sysfs_remove_dir
);
EXPORT_SYMBOL
(
sysfs_remove_dir
);
EXPORT_SYMBOL
(
sysfs_rename_dir
);
include/linux/sysfs.h
View file @
f91c01ac
...
@@ -39,6 +39,9 @@ sysfs_create_dir(struct kobject *);
...
@@ -39,6 +39,9 @@ sysfs_create_dir(struct kobject *);
extern
void
extern
void
sysfs_remove_dir
(
struct
kobject
*
);
sysfs_remove_dir
(
struct
kobject
*
);
extern
void
sysfs_rename_dir
(
struct
kobject
*
,
char
*
new_name
);
extern
int
extern
int
sysfs_create_file
(
struct
kobject
*
,
struct
attribute
*
);
sysfs_create_file
(
struct
kobject
*
,
struct
attribute
*
);
...
...
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