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
59482291
Commit
59482291
authored
Aug 19, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vme: don't open-code fixed_size_llseek()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
91360b02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
25 deletions
+3
-25
drivers/staging/vme/devices/vme_user.c
drivers/staging/vme/devices/vme_user.c
+3
-25
No files found.
drivers/staging/vme/devices/vme_user.c
View file @
59482291
...
...
@@ -410,41 +410,19 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
static
loff_t
vme_user_llseek
(
struct
file
*
file
,
loff_t
off
,
int
whence
)
{
loff_t
absolute
=
-
1
;
unsigned
int
minor
=
MINOR
(
file_inode
(
file
)
->
i_rdev
);
size_t
image_size
;
loff_t
res
;
if
(
minor
==
CONTROL_MINOR
)
return
-
EINVAL
;
mutex_lock
(
&
image
[
minor
].
mutex
);
image_size
=
vme_get_size
(
image
[
minor
].
resource
);
switch
(
whence
)
{
case
SEEK_SET
:
absolute
=
off
;
break
;
case
SEEK_CUR
:
absolute
=
file
->
f_pos
+
off
;
break
;
case
SEEK_END
:
absolute
=
image_size
+
off
;
break
;
default:
mutex_unlock
(
&
image
[
minor
].
mutex
);
return
-
EINVAL
;
}
if
((
absolute
<
0
)
||
(
absolute
>=
image_size
))
{
mutex_unlock
(
&
image
[
minor
].
mutex
);
return
-
EINVAL
;
}
file
->
f_pos
=
absolute
;
res
=
fixed_size_llseek
(
file
,
off
,
whence
,
image_size
);
mutex_unlock
(
&
image
[
minor
].
mutex
);
return
absolute
;
return
res
;
}
/*
...
...
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