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
4a343664
Commit
4a343664
authored
Aug 15, 2016
by
Martin Brandenburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orangefs: remove duplicated sysfs_ops structures
Signed-off-by:
Martin Brandenburg
<
martin@omnibond.com
>
parent
7b0cae60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
58 deletions
+15
-58
fs/orangefs/orangefs-sysfs.c
fs/orangefs/orangefs-sysfs.c
+15
-58
No files found.
fs/orangefs/orangefs-sysfs.c
View file @
4a343664
...
...
@@ -155,19 +155,11 @@ static ssize_t orangefs_attr_show(struct kobject *kobj,
char
*
buf
)
{
struct
orangefs_attribute
*
attribute
;
int
rc
;
attribute
=
container_of
(
attr
,
struct
orangefs_attribute
,
attr
);
if
(
!
attribute
->
show
)
{
rc
=
-
EIO
;
goto
out
;
}
rc
=
attribute
->
show
(
kobj
,
attribute
,
buf
);
out:
return
rc
;
if
(
!
attribute
->
show
)
return
-
EIO
;
return
attribute
->
show
(
kobj
,
attribute
,
buf
);
}
static
ssize_t
orangefs_attr_store
(
struct
kobject
*
kobj
,
...
...
@@ -176,22 +168,15 @@ static ssize_t orangefs_attr_store(struct kobject *kobj,
size_t
len
)
{
struct
orangefs_attribute
*
attribute
;
int
rc
;
gossip_debug
(
GOSSIP_SYSFS_DEBUG
,
"orangefs_attr_store: start
\n
"
);
if
(
!
strcmp
(
kobj
->
name
,
PC_KOBJ_ID
)
||
!
strcmp
(
kobj
->
name
,
STATS_KOBJ_ID
))
return
-
EPERM
;
attribute
=
container_of
(
attr
,
struct
orangefs_attribute
,
attr
);
if
(
!
attribute
->
store
)
{
rc
=
-
EIO
;
goto
out
;
}
rc
=
attribute
->
store
(
kobj
,
attribute
,
buf
,
len
);
out:
return
rc
;
if
(
!
attribute
->
store
)
return
-
EIO
;
return
attribute
->
store
(
kobj
,
attribute
,
buf
,
len
);
}
static
const
struct
sysfs_ops
orangefs_sysfs_ops
=
{
...
...
@@ -199,34 +184,6 @@ static const struct sysfs_ops orangefs_sysfs_ops = {
.
store
=
orangefs_attr_store
,
};
static
const
struct
sysfs_ops
acache_orangefs_sysfs_ops
=
{
.
show
=
orangefs_attr_show
,
.
store
=
orangefs_attr_store
,
};
static
const
struct
sysfs_ops
capcache_orangefs_sysfs_ops
=
{
.
show
=
orangefs_attr_show
,
.
store
=
orangefs_attr_store
,
};
static
const
struct
sysfs_ops
ccache_orangefs_sysfs_ops
=
{
.
show
=
orangefs_attr_show
,
.
store
=
orangefs_attr_store
,
};
static
const
struct
sysfs_ops
ncache_orangefs_sysfs_ops
=
{
.
show
=
orangefs_attr_show
,
.
store
=
orangefs_attr_store
,
};
static
const
struct
sysfs_ops
pc_orangefs_sysfs_ops
=
{
.
show
=
orangefs_attr_show
,
};
static
const
struct
sysfs_ops
stats_orangefs_sysfs_ops
=
{
.
show
=
orangefs_attr_show
,
};
static
ssize_t
sysfs_int_show
(
struct
kobject
*
kobj
,
struct
orangefs_attribute
*
attr
,
char
*
buf
)
{
...
...
@@ -909,7 +866,7 @@ static struct attribute *acache_orangefs_default_attrs[] = {
};
static
struct
kobj_type
acache_orangefs_ktype
=
{
.
sysfs_ops
=
&
acache_
orangefs_sysfs_ops
,
.
sysfs_ops
=
&
orangefs_sysfs_ops
,
.
default_attrs
=
acache_orangefs_default_attrs
,
};
...
...
@@ -946,7 +903,7 @@ static struct attribute *capcache_orangefs_default_attrs[] = {
};
static
struct
kobj_type
capcache_orangefs_ktype
=
{
.
sysfs_ops
=
&
capcache_
orangefs_sysfs_ops
,
.
sysfs_ops
=
&
orangefs_sysfs_ops
,
.
default_attrs
=
capcache_orangefs_default_attrs
,
};
...
...
@@ -983,7 +940,7 @@ static struct attribute *ccache_orangefs_default_attrs[] = {
};
static
struct
kobj_type
ccache_orangefs_ktype
=
{
.
sysfs_ops
=
&
ccache_
orangefs_sysfs_ops
,
.
sysfs_ops
=
&
orangefs_sysfs_ops
,
.
default_attrs
=
ccache_orangefs_default_attrs
,
};
...
...
@@ -1020,7 +977,7 @@ static struct attribute *ncache_orangefs_default_attrs[] = {
};
static
struct
kobj_type
ncache_orangefs_ktype
=
{
.
sysfs_ops
=
&
ncache_
orangefs_sysfs_ops
,
.
sysfs_ops
=
&
orangefs_sysfs_ops
,
.
default_attrs
=
ncache_orangefs_default_attrs
,
};
...
...
@@ -1050,7 +1007,7 @@ static struct attribute *pc_orangefs_default_attrs[] = {
};
static
struct
kobj_type
pc_orangefs_ktype
=
{
.
sysfs_ops
=
&
pc_
orangefs_sysfs_ops
,
.
sysfs_ops
=
&
orangefs_sysfs_ops
,
.
default_attrs
=
pc_orangefs_default_attrs
,
};
...
...
@@ -1073,7 +1030,7 @@ static struct attribute *stats_orangefs_default_attrs[] = {
};
static
struct
kobj_type
stats_orangefs_ktype
=
{
.
sysfs_ops
=
&
stats_
orangefs_sysfs_ops
,
.
sysfs_ops
=
&
orangefs_sysfs_ops
,
.
default_attrs
=
stats_orangefs_default_attrs
,
};
...
...
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