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
bf2965d5
Commit
bf2965d5
authored
Aug 26, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch ftruncate(2) to fget_light
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
f6d2ac5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
fs/open.c
fs/open.c
+5
-5
No files found.
fs/open.c
View file @
bf2965d5
...
...
@@ -132,16 +132,16 @@ SYSCALL_DEFINE2(truncate, const char __user *, path, long, length)
static
long
do_sys_ftruncate
(
unsigned
int
fd
,
loff_t
length
,
int
small
)
{
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
dentry
*
dentry
;
struct
file
*
file
;
int
error
;
struct
file
*
file
;
int
error
,
fput_needed
;
error
=
-
EINVAL
;
if
(
length
<
0
)
goto
out
;
error
=
-
EBADF
;
file
=
fget
(
f
d
);
file
=
fget
_light
(
fd
,
&
fput_neede
d
);
if
(
!
file
)
goto
out
;
...
...
@@ -172,7 +172,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
error
=
do_truncate
(
dentry
,
length
,
ATTR_MTIME
|
ATTR_CTIME
,
file
);
sb_end_write
(
inode
->
i_sb
);
out_putf:
fput
(
file
);
fput
_light
(
file
,
fput_needed
);
out:
return
error
;
}
...
...
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