diff options
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 39646f224514..5439d6a56e99 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -233,8 +233,8 @@ group_extend_out: | |||
233 | 233 | ||
234 | case EXT4_IOC_MOVE_EXT: { | 234 | case EXT4_IOC_MOVE_EXT: { |
235 | struct move_extent me; | 235 | struct move_extent me; |
236 | struct file *donor_filp; | 236 | struct fd donor; |
237 | int err, fput_needed; | 237 | int err; |
238 | 238 | ||
239 | if (!(filp->f_mode & FMODE_READ) || | 239 | if (!(filp->f_mode & FMODE_READ) || |
240 | !(filp->f_mode & FMODE_WRITE)) | 240 | !(filp->f_mode & FMODE_WRITE)) |
@@ -245,11 +245,11 @@ group_extend_out: | |||
245 | return -EFAULT; | 245 | return -EFAULT; |
246 | me.moved_len = 0; | 246 | me.moved_len = 0; |
247 | 247 | ||
248 | donor_filp = fget_light(me.donor_fd, &fput_needed); | 248 | donor = fdget(me.donor_fd); |
249 | if (!donor_filp) | 249 | if (!donor.file) |
250 | return -EBADF; | 250 | return -EBADF; |
251 | 251 | ||
252 | if (!(donor_filp->f_mode & FMODE_WRITE)) { | 252 | if (!(donor.file->f_mode & FMODE_WRITE)) { |
253 | err = -EBADF; | 253 | err = -EBADF; |
254 | goto mext_out; | 254 | goto mext_out; |
255 | } | 255 | } |
@@ -266,7 +266,7 @@ group_extend_out: | |||
266 | if (err) | 266 | if (err) |
267 | goto mext_out; | 267 | goto mext_out; |
268 | 268 | ||
269 | err = ext4_move_extents(filp, donor_filp, me.orig_start, | 269 | err = ext4_move_extents(filp, donor.file, me.orig_start, |
270 | me.donor_start, me.len, &me.moved_len); | 270 | me.donor_start, me.len, &me.moved_len); |
271 | mnt_drop_write_file(filp); | 271 | mnt_drop_write_file(filp); |
272 | 272 | ||
@@ -274,7 +274,7 @@ group_extend_out: | |||
274 | &me, sizeof(me))) | 274 | &me, sizeof(me))) |
275 | err = -EFAULT; | 275 | err = -EFAULT; |
276 | mext_out: | 276 | mext_out: |
277 | fput_light(donor_filp, fput_needed); | 277 | fdput(donor); |
278 | return err; | 278 | return err; |
279 | } | 279 | } |
280 | 280 | ||