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
1bf9d14d
Commit
1bf9d14d
authored
Jun 16, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new helper: fixed_size_llseek()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0747fdb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
fs/read_write.c
fs/read_write.c
+20
-0
include/linux/fs.h
include/linux/fs.h
+2
-0
No files found.
fs/read_write.c
View file @
1bf9d14d
...
...
@@ -144,6 +144,26 @@ loff_t generic_file_llseek(struct file *file, loff_t offset, int whence)
}
EXPORT_SYMBOL
(
generic_file_llseek
);
/**
* fixed_size_llseek - llseek implementation for fixed-sized devices
* @file: file structure to seek on
* @offset: file offset to seek to
* @whence: type of seek
* @size: size of the file
*
*/
loff_t
fixed_size_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
whence
,
loff_t
size
)
{
switch
(
whence
)
{
case
SEEK_SET
:
case
SEEK_CUR
:
case
SEEK_END
:
return
generic_file_llseek_size
(
file
,
offset
,
whence
,
size
,
size
);
default:
return
-
EINVAL
;
}
}
EXPORT_SYMBOL
(
fixed_size_llseek
);
/**
* noop_llseek - No Operation Performed llseek implementation
* @file: file structure to seek on
...
...
include/linux/fs.h
View file @
1bf9d14d
...
...
@@ -2428,6 +2428,8 @@ extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
extern
loff_t
generic_file_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
whence
);
extern
loff_t
generic_file_llseek_size
(
struct
file
*
file
,
loff_t
offset
,
int
whence
,
loff_t
maxsize
,
loff_t
eof
);
extern
loff_t
fixed_size_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
whence
,
loff_t
size
);
extern
int
generic_file_open
(
struct
inode
*
inode
,
struct
file
*
filp
);
extern
int
nonseekable_open
(
struct
inode
*
inode
,
struct
file
*
filp
);
...
...
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