diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-27 16:47:29 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-27 01:10:10 (GMT) |
commit | 88b428d6e191affae79b5c1f4764dfdebab9fae6 (patch) | |
tree | a59aef2791615ce3093cd200b3fd2c803ff2f441 /drivers/infiniband/core/uverbs_cmd.c | |
parent | 1d3653a79c4eedf5d6eaaa7328b1d134012b2509 (diff) | |
download | linux-fsl-qoriq-88b428d6e191affae79b5c1f4764dfdebab9fae6.tar.xz |
switch infinibarf users of fget() to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/infiniband/core/uverbs_cmd.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_cmd.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index f9d0d7c..402679b 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -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.fd); + f = fget_light(cmd.fd, &fput_needed); 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 @@ err: err_tree_mutex_unlock: if (f) - fput(f); + fput_light(f, fput_needed); mutex_unlock(&file->device->xrcd_tree_mutex); |