diff options
Diffstat (limited to 'fs/xfs/xfs_dfrag.c')
-rw-r--r-- | fs/xfs/xfs_dfrag.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 070259a4254c..c6191d00ad27 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
@@ -60,8 +60,6 @@ xfs_swapext( | |||
60 | xfs_bstat_t *sbp; | 60 | xfs_bstat_t *sbp; |
61 | struct file *fp = NULL, *tfp = NULL; | 61 | struct file *fp = NULL, *tfp = NULL; |
62 | vnode_t *vp, *tvp; | 62 | vnode_t *vp, *tvp; |
63 | bhv_desc_t *bdp, *tbdp; | ||
64 | vn_bhv_head_t *bhp, *tbhp; | ||
65 | static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; | 63 | static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; |
66 | int ilf_fields, tilf_fields; | 64 | int ilf_fields, tilf_fields; |
67 | int error = 0; | 65 | int error = 0; |
@@ -90,13 +88,10 @@ xfs_swapext( | |||
90 | goto error0; | 88 | goto error0; |
91 | } | 89 | } |
92 | 90 | ||
93 | bhp = VN_BHV_HEAD(vp); | 91 | ip = xfs_vtoi(vp); |
94 | bdp = vn_bhv_lookup(bhp, &xfs_vnodeops); | 92 | if (ip == NULL) { |
95 | if (bdp == NULL) { | ||
96 | error = XFS_ERROR(EBADF); | 93 | error = XFS_ERROR(EBADF); |
97 | goto error0; | 94 | goto error0; |
98 | } else { | ||
99 | ip = XFS_BHVTOI(bdp); | ||
100 | } | 95 | } |
101 | 96 | ||
102 | if (((tfp = fget((int)sxp->sx_fdtmp)) == NULL) || | 97 | if (((tfp = fget((int)sxp->sx_fdtmp)) == NULL) || |
@@ -105,13 +100,10 @@ xfs_swapext( | |||
105 | goto error0; | 100 | goto error0; |
106 | } | 101 | } |
107 | 102 | ||
108 | tbhp = VN_BHV_HEAD(tvp); | 103 | tip = xfs_vtoi(tvp); |
109 | tbdp = vn_bhv_lookup(tbhp, &xfs_vnodeops); | 104 | if (tip == NULL) { |
110 | if (tbdp == NULL) { | ||
111 | error = XFS_ERROR(EBADF); | 105 | error = XFS_ERROR(EBADF); |
112 | goto error0; | 106 | goto error0; |
113 | } else { | ||
114 | tip = XFS_BHVTOI(tbdp); | ||
115 | } | 107 | } |
116 | 108 | ||
117 | if (ip->i_mount != tip->i_mount) { | 109 | if (ip->i_mount != tip->i_mount) { |