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
24e56f5e
Commit
24e56f5e
authored
Aug 11, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sysfs] Mark some arguments const.
From Stephen Hemminger
parent
e6289147
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
22 deletions
+25
-22
fs/sysfs/dir.c
fs/sysfs/dir.c
+3
-3
fs/sysfs/file.c
fs/sysfs/file.c
+4
-4
fs/sysfs/group.c
fs/sysfs/group.c
+9
-6
fs/sysfs/sysfs.h
fs/sysfs/sysfs.h
+3
-3
include/linux/sysfs.h
include/linux/sysfs.h
+6
-6
No files found.
fs/sysfs/dir.c
View file @
24e56f5e
...
...
@@ -22,7 +22,7 @@ static int init_dir(struct inode * inode)
static
struct
dentry
*
create_dir
(
struct
kobject
*
k
,
struct
dentry
*
p
,
char
*
n
)
create_dir
(
struct
kobject
*
k
,
struct
dentry
*
p
,
c
onst
c
har
*
n
)
{
struct
dentry
*
dentry
;
...
...
@@ -47,7 +47,7 @@ create_dir(struct kobject * k, struct dentry * p, char * n)
}
struct
dentry
*
sysfs_create_subdir
(
struct
kobject
*
k
,
char
*
n
)
struct
dentry
*
sysfs_create_subdir
(
struct
kobject
*
k
,
c
onst
c
har
*
n
)
{
return
create_dir
(
k
,
k
->
dentry
,
n
);
}
...
...
@@ -155,7 +155,7 @@ void sysfs_remove_dir(struct kobject * kobj)
dput
(
dentry
);
}
void
sysfs_rename_dir
(
struct
kobject
*
kobj
,
char
*
new_name
)
void
sysfs_rename_dir
(
struct
kobject
*
kobj
,
c
onst
c
har
*
new_name
)
{
struct
dentry
*
new_dentry
,
*
parent
;
...
...
fs/sysfs/file.c
View file @
24e56f5e
...
...
@@ -345,7 +345,7 @@ static struct file_operations sysfs_file_operations = {
};
int
sysfs_add_file
(
struct
dentry
*
dir
,
struct
attribute
*
attr
)
int
sysfs_add_file
(
struct
dentry
*
dir
,
const
struct
attribute
*
attr
)
{
struct
dentry
*
dentry
;
int
error
;
...
...
@@ -368,7 +368,7 @@ int sysfs_add_file(struct dentry * dir, struct attribute * attr)
* @attr: atrribute descriptor.
*/
int
sysfs_create_file
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
)
int
sysfs_create_file
(
struct
kobject
*
kobj
,
const
struct
attribute
*
attr
)
{
if
(
kobj
&&
attr
)
return
sysfs_add_file
(
kobj
->
dentry
,
attr
);
...
...
@@ -384,7 +384,7 @@ int sysfs_create_file(struct kobject * kobj, struct attribute * attr)
* Also call dnotify for the dentry, which lots of userspace programs
* use.
*/
int
sysfs_update_file
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
)
int
sysfs_update_file
(
struct
kobject
*
kobj
,
const
struct
attribute
*
attr
)
{
struct
dentry
*
dir
=
kobj
->
dentry
;
struct
dentry
*
victim
;
...
...
@@ -425,7 +425,7 @@ int sysfs_update_file(struct kobject * kobj, struct attribute * attr)
* Hash the attribute name and kill the victim.
*/
void
sysfs_remove_file
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
)
void
sysfs_remove_file
(
struct
kobject
*
kobj
,
const
struct
attribute
*
attr
)
{
sysfs_hash_and_remove
(
kobj
->
dentry
,
attr
->
name
);
}
...
...
fs/sysfs/group.c
View file @
24e56f5e
...
...
@@ -15,18 +15,19 @@
#include "sysfs.h"
static
void
remove_files
(
struct
dentry
*
dir
,
struct
attribute_group
*
grp
)
static
void
remove_files
(
struct
dentry
*
dir
,
const
struct
attribute_group
*
grp
)
{
struct
attribute
**
attr
;
struct
attribute
*
const
*
attr
;
for
(
attr
=
grp
->
attrs
;
*
attr
;
attr
++
)
sysfs_hash_and_remove
(
dir
,(
*
attr
)
->
name
);
}
static
int
create_files
(
struct
dentry
*
dir
,
struct
attribute_group
*
grp
)
const
struct
attribute_group
*
grp
)
{
struct
attribute
**
attr
;
struct
attribute
*
const
*
attr
;
int
error
=
0
;
for
(
attr
=
grp
->
attrs
;
*
attr
&&
!
error
;
attr
++
)
{
...
...
@@ -38,7 +39,8 @@ static int create_files(struct dentry * dir,
}
int
sysfs_create_group
(
struct
kobject
*
kobj
,
struct
attribute_group
*
grp
)
int
sysfs_create_group
(
struct
kobject
*
kobj
,
const
struct
attribute_group
*
grp
)
{
struct
dentry
*
dir
;
int
error
;
...
...
@@ -58,7 +60,8 @@ int sysfs_create_group(struct kobject * kobj, struct attribute_group * grp)
return
error
;
}
void
sysfs_remove_group
(
struct
kobject
*
kobj
,
struct
attribute_group
*
grp
)
void
sysfs_remove_group
(
struct
kobject
*
kobj
,
const
struct
attribute_group
*
grp
)
{
struct
dentry
*
dir
;
...
...
fs/sysfs/sysfs.h
View file @
24e56f5e
...
...
@@ -4,10 +4,10 @@ extern struct vfsmount * sysfs_mount;
extern
struct
inode
*
sysfs_new_inode
(
mode_t
mode
);
extern
int
sysfs_create
(
struct
dentry
*
,
int
mode
,
int
(
*
init
)(
struct
inode
*
));
extern
struct
dentry
*
sysfs_get_dentry
(
struct
dentry
*
,
char
*
);
extern
struct
dentry
*
sysfs_get_dentry
(
struct
dentry
*
,
c
onst
c
har
*
);
extern
int
sysfs_add_file
(
struct
dentry
*
dir
,
struct
attribute
*
attr
);
extern
int
sysfs_add_file
(
struct
dentry
*
dir
,
const
struct
attribute
*
attr
);
extern
void
sysfs_hash_and_remove
(
struct
dentry
*
dir
,
const
char
*
name
);
extern
struct
dentry
*
sysfs_create_subdir
(
struct
kobject
*
,
char
*
);
extern
struct
dentry
*
sysfs_create_subdir
(
struct
kobject
*
,
c
onst
c
har
*
);
extern
void
sysfs_remove_subdir
(
struct
dentry
*
);
include/linux/sysfs.h
View file @
24e56f5e
...
...
@@ -40,16 +40,16 @@ extern void
sysfs_remove_dir
(
struct
kobject
*
);
extern
void
sysfs_rename_dir
(
struct
kobject
*
,
char
*
new_name
);
sysfs_rename_dir
(
struct
kobject
*
,
c
onst
c
har
*
new_name
);
extern
int
sysfs_create_file
(
struct
kobject
*
,
struct
attribute
*
);
sysfs_create_file
(
struct
kobject
*
,
const
struct
attribute
*
);
extern
int
sysfs_update_file
(
struct
kobject
*
,
struct
attribute
*
);
sysfs_update_file
(
struct
kobject
*
,
const
struct
attribute
*
);
extern
void
sysfs_remove_file
(
struct
kobject
*
,
struct
attribute
*
);
sysfs_remove_file
(
struct
kobject
*
,
const
struct
attribute
*
);
extern
int
sysfs_create_link
(
struct
kobject
*
kobj
,
struct
kobject
*
target
,
char
*
name
);
...
...
@@ -63,7 +63,7 @@ struct attribute_group {
struct
attribute
**
attrs
;
};
int
sysfs_create_group
(
struct
kobject
*
,
struct
attribute_group
*
);
void
sysfs_remove_group
(
struct
kobject
*
,
struct
attribute_group
*
);
int
sysfs_create_group
(
struct
kobject
*
,
const
struct
attribute_group
*
);
void
sysfs_remove_group
(
struct
kobject
*
,
const
struct
attribute_group
*
);
#endif
/* _SYSFS_H_ */
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