summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dfrag.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-28 12:52:22 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-26 22:20:08 -0400
commit2903ff019b346ab8d36ebbf54853c3aaf6590608 (patch)
tree962d94054765bb37bc00e977c3036e65c5fd91fe /fs/xfs/xfs_dfrag.c
parenta5b470ba06aa3f96999ede5feba178df6bdb134a (diff)
downloadop-kernel-dev-2903ff019b346ab8d36ebbf54853c3aaf6590608.zip
op-kernel-dev-2903ff019b346ab8d36ebbf54853c3aaf6590608.tar.gz
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs/xfs_dfrag.c')
-rw-r--r--fs/xfs/xfs_dfrag.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c
index e6cdf22..b9b8646 100644
--- a/fs/xfs/xfs_dfrag.c
+++ b/fs/xfs/xfs_dfrag.c
@@ -48,44 +48,44 @@ xfs_swapext(
xfs_swapext_t *sxp)
{
xfs_inode_t *ip, *tip;
- struct file *file, *tmp_file;
- int error = 0, fput_needed, fput_needed_tmp;
+ struct fd f, tmp;
+ int error = 0;
/* Pull information for the target fd */
- file = fget_light((int)sxp->sx_fdtarget, &fput_needed);
- if (!file) {
+ f = fdget((int)sxp->sx_fdtarget);
+ if (!f.file) {
error = XFS_ERROR(EINVAL);
goto out;
}
- if (!(file->f_mode & FMODE_WRITE) ||
- !(file->f_mode & FMODE_READ) ||
- (file->f_flags & O_APPEND)) {
+ if (!(f.file->f_mode & FMODE_WRITE) ||
+ !(f.file->f_mode & FMODE_READ) ||
+ (f.file->f_flags & O_APPEND)) {
error = XFS_ERROR(EBADF);
goto out_put_file;
}
- tmp_file = fget_light((int)sxp->sx_fdtmp, &fput_needed_tmp);
- if (!tmp_file) {
+ tmp = fdget((int)sxp->sx_fdtmp);
+ if (!tmp.file) {
error = XFS_ERROR(EINVAL);
goto out_put_file;
}
- if (!(tmp_file->f_mode & FMODE_WRITE) ||
- !(tmp_file->f_mode & FMODE_READ) ||
- (tmp_file->f_flags & O_APPEND)) {
+ if (!(tmp.file->f_mode & FMODE_WRITE) ||
+ !(tmp.file->f_mode & FMODE_READ) ||
+ (tmp.file->f_flags & O_APPEND)) {
error = XFS_ERROR(EBADF);
goto out_put_tmp_file;
}
- if (IS_SWAPFILE(file->f_path.dentry->d_inode) ||
- IS_SWAPFILE(tmp_file->f_path.dentry->d_inode)) {
+ if (IS_SWAPFILE(f.file->f_path.dentry->d_inode) ||
+ IS_SWAPFILE(tmp.file->f_path.dentry->d_inode)) {
error = XFS_ERROR(EINVAL);
goto out_put_tmp_file;
}
- ip = XFS_I(file->f_path.dentry->d_inode);
- tip = XFS_I(tmp_file->f_path.dentry->d_inode);
+ ip = XFS_I(f.file->f_path.dentry->d_inode);
+ tip = XFS_I(tmp.file->f_path.dentry->d_inode);
if (ip->i_mount != tip->i_mount) {
error = XFS_ERROR(EINVAL);
@@ -105,9 +105,9 @@ xfs_swapext(
error = xfs_swap_extents(ip, tip, sxp);
out_put_tmp_file:
- fput_light(tmp_file, fput_needed_tmp);
+ fdput(tmp);
out_put_file:
- fput_light(file, fput_needed);
+ fdput(f);
out:
return error;
}
OpenPOWER on IntegriCloud