switch simple cases of fget_light to fdget
[linux-2.6-block.git] / drivers / vfio / vfio.c
index 91bcd97d30616a302707b777634a859bc83b93e8..56097c6d072d0797ecc9c13c9d2d231aa3e9afa8 100644 (file)
@@ -1014,25 +1014,25 @@ static void vfio_group_try_dissolve_container(struct vfio_group *group)
 
 static int vfio_group_set_container(struct vfio_group *group, int container_fd)
 {
-       struct file *filep;
+       struct fd f;
        struct vfio_container *container;
        struct vfio_iommu_driver *driver;
-       int ret = 0, fput_needed;
+       int ret = 0;
 
        if (atomic_read(&group->container_users))
                return -EINVAL;
 
-       filep = fget_light(container_fd, &fput_needed);
-       if (!filep)
+       f = fdget(container_fd);
+       if (!f.file)
                return -EBADF;
 
        /* Sanity check, is this really our fd? */
-       if (filep->f_op != &vfio_fops) {
-               fput_light(filep, fput_needed);
+       if (f.file->f_op != &vfio_fops) {
+               fdput(f);
                return -EINVAL;
        }
 
-       container = filep->private_data;
+       container = f.file->private_data;
        WARN_ON(!container); /* fget ensures we don't race vfio_release */
 
        mutex_lock(&container->group_lock);
@@ -1054,8 +1054,7 @@ static int vfio_group_set_container(struct vfio_group *group, int container_fd)
 
 unlock_out:
        mutex_unlock(&container->group_lock);
-       fput_light(filep, fput_needed);
-
+       fdput(f);
        return ret;
 }