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
ecd18815
Commit
ecd18815
authored
Aug 26, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch btrfs_ioctl_snap_create_transid() to fget_light()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
6bdf2954
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
fs/btrfs/ioctl.c
fs/btrfs/ioctl.c
+7
-7
No files found.
fs/btrfs/ioctl.c
View file @
ecd18815
...
@@ -1422,7 +1422,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
...
@@ -1422,7 +1422,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
NULL
,
transid
,
readonly
,
inherit
);
NULL
,
transid
,
readonly
,
inherit
);
}
else
{
}
else
{
struct
inode
*
src_inode
;
struct
inode
*
src_inode
;
src_file
=
fget
(
fd
);
int
fput_needed
;
src_file
=
fget_light
(
fd
,
&
fput_needed
);
if
(
!
src_file
)
{
if
(
!
src_file
)
{
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
goto
out_drop_write
;
goto
out_drop_write
;
...
@@ -1433,13 +1434,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
...
@@ -1433,13 +1434,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
printk
(
KERN_INFO
"btrfs: Snapshot src from "
printk
(
KERN_INFO
"btrfs: Snapshot src from "
"another FS
\n
"
);
"another FS
\n
"
);
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
fput
(
src_file
);
}
else
{
goto
out_drop_write
;
ret
=
btrfs_mksubvol
(
&
file
->
f_path
,
name
,
namelen
,
BTRFS_I
(
src_inode
)
->
root
,
transid
,
readonly
,
inherit
);
}
}
ret
=
btrfs_mksubvol
(
&
file
->
f_path
,
name
,
namelen
,
fput_light
(
src_file
,
fput_needed
);
BTRFS_I
(
src_inode
)
->
root
,
transid
,
readonly
,
inherit
);
fput
(
src_file
);
}
}
out_drop_write:
out_drop_write:
mnt_drop_write_file
(
file
);
mnt_drop_write_file
(
file
);
...
...
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