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
88b428d6
Commit
88b428d6
authored
Aug 27, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch infinibarf users of fget() to fget_light()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
1d3653a7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
14 deletions
+10
-14
drivers/infiniband/core/ucma.c
drivers/infiniband/core/ucma.c
+3
-3
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/uverbs_cmd.c
+4
-9
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/core/uverbs_main.c
+3
-2
No files found.
drivers/infiniband/core/ucma.c
View file @
88b428d6
...
...
@@ -1186,13 +1186,13 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
struct
ucma_context
*
ctx
;
struct
file
*
filp
;
struct
ucma_file
*
cur_file
;
int
ret
=
0
;
int
ret
=
0
,
fput_needed
;
if
(
copy_from_user
(
&
cmd
,
inbuf
,
sizeof
(
cmd
)))
return
-
EFAULT
;
/* Get current fd to protect against it being closed */
filp
=
fget
(
cmd
.
f
d
);
filp
=
fget
_light
(
cmd
.
fd
,
&
fput_neede
d
);
if
(
!
filp
)
return
-
ENOENT
;
...
...
@@ -1231,7 +1231,7 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
ucma_put_ctx
(
ctx
);
file_put:
fput
(
filp
);
fput
_light
(
filp
,
fput_needed
);
return
ret
;
}
...
...
drivers/infiniband/core/uverbs_cmd.c
View file @
88b428d6
...
...
@@ -707,7 +707,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
struct
ib_xrcd
*
xrcd
=
NULL
;
struct
file
*
f
=
NULL
;
struct
inode
*
inode
=
NULL
;
int
ret
=
0
;
int
ret
=
0
,
fput_needed
;
int
new_xrcd
=
0
;
if
(
out_len
<
sizeof
resp
)
...
...
@@ -724,18 +724,13 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
if
(
cmd
.
fd
!=
-
1
)
{
/* search for file descriptor */
f
=
fget
(
cmd
.
f
d
);
f
=
fget
_light
(
cmd
.
fd
,
&
fput_neede
d
);
if
(
!
f
)
{
ret
=
-
EBADF
;
goto
err_tree_mutex_unlock
;
}
inode
=
f
->
f_dentry
->
d_inode
;
if
(
!
inode
)
{
ret
=
-
EBADF
;
goto
err_tree_mutex_unlock
;
}
xrcd
=
find_xrcd
(
file
->
device
,
inode
);
if
(
!
xrcd
&&
!
(
cmd
.
oflags
&
O_CREAT
))
{
/* no file descriptor. Need CREATE flag */
...
...
@@ -801,7 +796,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
}
if
(
f
)
fput
(
f
);
fput
_light
(
f
,
fput_needed
);
mutex_lock
(
&
file
->
mutex
);
list_add_tail
(
&
obj
->
uobject
.
list
,
&
file
->
ucontext
->
xrcd_list
);
...
...
@@ -831,7 +826,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
err_tree_mutex_unlock:
if
(
f
)
fput
(
f
);
fput
_light
(
f
,
fput_needed
);
mutex_unlock
(
&
file
->
device
->
xrcd_tree_mutex
);
...
...
drivers/infiniband/core/uverbs_main.c
View file @
88b428d6
...
...
@@ -542,8 +542,9 @@ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
{
struct
ib_uverbs_event_file
*
ev_file
=
NULL
;
struct
file
*
filp
;
int
fput_needed
;
filp
=
fget
(
f
d
);
filp
=
fget
_light
(
fd
,
&
fput_neede
d
);
if
(
!
filp
)
return
NULL
;
...
...
@@ -559,7 +560,7 @@ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
kref_get
(
&
ev_file
->
ref
);
out:
fput
(
filp
);
fput
_light
(
filp
,
fput_needed
);
return
ev_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