Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
a69755b1
Commit
a69755b1
authored
12 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
xtensa simdisk: switch to proc_create_data()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
78846ce6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arch/xtensa/platforms/iss/simdisk.c
+23
-13
23 additions, 13 deletions
arch/xtensa/platforms/iss/simdisk.c
with
23 additions
and
13 deletions
arch/xtensa/platforms/iss/simdisk.c
+
23
−
13
View file @
a69755b1
...
...
@@ -214,20 +214,27 @@ static int simdisk_detach(struct simdisk *dev)
return
err
;
}
static
in
t
proc_read_simdisk
(
char
*
page
,
char
**
start
,
off_t
of
f
,
int
count
,
int
*
eof
,
void
*
data
)
static
ssize_
t
proc_read_simdisk
(
struct
file
*
file
,
char
__user
*
bu
f
,
size_t
size
,
loff_t
*
ppos
)
{
int
len
;
struct
simdisk
*
dev
=
(
struct
simdisk
*
)
data
;
len
=
sprintf
(
page
,
"%s
\n
"
,
dev
->
filename
?
dev
->
filename
:
""
);
return
len
;
struct
simdisk
*
dev
=
PDE
(
file_inode
(
file
))
->
data
;
char
*
s
=
dev
->
filename
;
if
(
s
)
{
ssize_t
n
=
simple_read_from_buffer
(
buf
,
size
,
ppos
,
s
,
strlen
(
s
));
if
(
n
<
0
)
return
n
;
buf
+=
n
;
size
-=
n
;
}
return
simple_read_from_buffer
(
buf
,
size
,
ppos
,
"
\n
"
,
1
);
}
static
in
t
proc_write_simdisk
(
struct
file
*
file
,
const
char
*
buf
fer
,
unsigned
long
count
,
void
*
data
)
static
ssize_
t
proc_write_simdisk
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
size
,
loff_t
*
ppos
)
{
char
*
tmp
=
kmalloc
(
count
+
1
,
GFP_KERNEL
);
struct
simdisk
*
dev
=
(
struct
simdisk
*
)
data
;
struct
simdisk
*
dev
=
PDE
(
file_inode
(
file
))
->
data
;
int
err
;
if
(
tmp
==
NULL
)
...
...
@@ -256,6 +263,12 @@ static int proc_write_simdisk(struct file *file, const char *buffer,
return
err
;
}
static
const
struct
file_operations
fops
=
{
.
read
=
proc_read_simdisk
,
.
write
=
proc_write_simdisk
,
.
llseek
=
default_llseek
,
};
static
int
__init
simdisk_setup
(
struct
simdisk
*
dev
,
int
which
,
struct
proc_dir_entry
*
procdir
)
{
...
...
@@ -289,10 +302,7 @@ static int __init simdisk_setup(struct simdisk *dev, int which,
set_capacity
(
dev
->
gd
,
0
);
add_disk
(
dev
->
gd
);
dev
->
procfile
=
create_proc_entry
(
tmp
,
0644
,
procdir
);
dev
->
procfile
->
data
=
dev
;
dev
->
procfile
->
read_proc
=
proc_read_simdisk
;
dev
->
procfile
->
write_proc
=
proc_write_simdisk
;
dev
->
procfile
=
proc_create_data
(
tmp
,
0644
,
procdir
,
&
fops
,
dev
);
return
0
;
out_alloc_disk:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment