Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linux-seco-imx
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Jira
Code
Merge requests
12
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Clea OS
bsp
nxp
linux-seco-imx
Commits
aab8848c
Commit
aab8848c
authored
6 years ago
by
Miklos Szeredi
Browse files
Options
Downloads
Patches
Plain Diff
ovl: add ovl_fallocate()
Implement stacked fallocate. Signed-off-by:
Miklos Szeredi
<
mszeredi@redhat.com
>
parent
2f502839
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
fs/overlayfs/file.c
+24
-0
24 additions, 0 deletions
fs/overlayfs/file.c
with
24 additions
and
0 deletions
fs/overlayfs/file.c
+
24
−
0
View file @
aab8848c
...
@@ -286,6 +286,29 @@ static int ovl_mmap(struct file *file, struct vm_area_struct *vma)
...
@@ -286,6 +286,29 @@ static int ovl_mmap(struct file *file, struct vm_area_struct *vma)
return
ret
;
return
ret
;
}
}
static
long
ovl_fallocate
(
struct
file
*
file
,
int
mode
,
loff_t
offset
,
loff_t
len
)
{
struct
inode
*
inode
=
file_inode
(
file
);
struct
fd
real
;
const
struct
cred
*
old_cred
;
int
ret
;
ret
=
ovl_real_fdget
(
file
,
&
real
);
if
(
ret
)
return
ret
;
old_cred
=
ovl_override_creds
(
file_inode
(
file
)
->
i_sb
);
ret
=
vfs_fallocate
(
real
.
file
,
mode
,
offset
,
len
);
revert_creds
(
old_cred
);
/* Update size */
ovl_copyattr
(
ovl_inode_real
(
inode
),
inode
);
fdput
(
real
);
return
ret
;
}
const
struct
file_operations
ovl_file_operations
=
{
const
struct
file_operations
ovl_file_operations
=
{
.
open
=
ovl_open
,
.
open
=
ovl_open
,
.
release
=
ovl_release
,
.
release
=
ovl_release
,
...
@@ -294,4 +317,5 @@ const struct file_operations ovl_file_operations = {
...
@@ -294,4 +317,5 @@ const struct file_operations ovl_file_operations = {
.
write_iter
=
ovl_write_iter
,
.
write_iter
=
ovl_write_iter
,
.
fsync
=
ovl_fsync
,
.
fsync
=
ovl_fsync
,
.
mmap
=
ovl_mmap
,
.
mmap
=
ovl_mmap
,
.
fallocate
=
ovl_fallocate
,
};
};
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