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
4a1f2f38
Commit
4a1f2f38
authored
Jun 23, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ubi/cdev: switch to fixed_size_llseek()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
54de90d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
25 deletions
+1
-25
drivers/mtd/ubi/cdev.c
drivers/mtd/ubi/cdev.c
+1
-25
No files found.
drivers/mtd/ubi/cdev.c
View file @
4a1f2f38
...
...
@@ -155,7 +155,6 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
{
struct
ubi_volume_desc
*
desc
=
file
->
private_data
;
struct
ubi_volume
*
vol
=
desc
->
vol
;
loff_t
new_offset
;
if
(
vol
->
updating
)
{
/* Update is in progress, seeking is prohibited */
...
...
@@ -163,30 +162,7 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
return
-
EBUSY
;
}
switch
(
origin
)
{
case
0
:
/* SEEK_SET */
new_offset
=
offset
;
break
;
case
1
:
/* SEEK_CUR */
new_offset
=
file
->
f_pos
+
offset
;
break
;
case
2
:
/* SEEK_END */
new_offset
=
vol
->
used_bytes
+
offset
;
break
;
default:
return
-
EINVAL
;
}
if
(
new_offset
<
0
||
new_offset
>
vol
->
used_bytes
)
{
ubi_err
(
"bad seek %lld"
,
new_offset
);
return
-
EINVAL
;
}
dbg_gen
(
"seek volume %d, offset %lld, origin %d, new offset %lld"
,
vol
->
vol_id
,
offset
,
origin
,
new_offset
);
file
->
f_pos
=
new_offset
;
return
new_offset
;
return
fixed_size_llseek
(
file
,
offset
,
origin
,
vol
->
used_bytes
);
}
static
int
vol_cdev_fsync
(
struct
file
*
file
,
loff_t
start
,
loff_t
end
,
...
...
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