aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-08-13 02:22:09 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-08-13 02:22:09 -0400
commitdf80c933f9eb01a7af3812bbe437e38205386304 (patch)
treeea20515f5f77558a63de202dcdb36fd96b91ffbd /fs
parente1cccd917be7364f81b5dc4e33ee3a6e0db21a99 (diff)
[XFS] remove some easy bhv_vnode_t instances
In various places we can just move a VFS_I call into the argument list of called functions/macros instead of having a local bhv_vnode_t. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31776a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c7
-rw-r--r--fs/xfs/xfs_dfrag.c9
-rw-r--r--fs/xfs/xfs_inode.c10
-rw-r--r--fs/xfs/xfs_itable.c4
-rw-r--r--fs/xfs/xfs_vfsops.c3
-rw-r--r--fs/xfs/xfs_vnodeops.c21
6 files changed, 17 insertions, 37 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 71ac3a6162e9..1ca593fb1225 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -980,12 +980,7 @@ STATIC struct inode *
980xfs_fs_alloc_inode( 980xfs_fs_alloc_inode(
981 struct super_block *sb) 981 struct super_block *sb)
982{ 982{
983 bhv_vnode_t *vp; 983 return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
984
985 vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
986 if (unlikely(!vp))
987 return NULL;
988 return vp;
989} 984}
990 985
991STATIC void 986STATIC void
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c
index 5ce91a00425f..760f4c5b5160 100644
--- a/fs/xfs/xfs_dfrag.c
+++ b/fs/xfs/xfs_dfrag.c
@@ -130,7 +130,6 @@ xfs_swap_extents(
130 xfs_mount_t *mp; 130 xfs_mount_t *mp;
131 xfs_trans_t *tp; 131 xfs_trans_t *tp;
132 xfs_bstat_t *sbp = &sxp->sx_stat; 132 xfs_bstat_t *sbp = &sxp->sx_stat;
133 bhv_vnode_t *vp, *tvp;
134 xfs_ifork_t *tempifp, *ifp, *tifp; 133 xfs_ifork_t *tempifp, *ifp, *tifp;
135 int ilf_fields, tilf_fields; 134 int ilf_fields, tilf_fields;
136 static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; 135 static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL;
@@ -149,8 +148,6 @@ xfs_swap_extents(
149 } 148 }
150 149
151 sbp = &sxp->sx_stat; 150 sbp = &sxp->sx_stat;
152 vp = VFS_I(ip);
153 tvp = VFS_I(tip);
154 151
155 xfs_lock_two_inodes(ip, tip, lock_flags); 152 xfs_lock_two_inodes(ip, tip, lock_flags);
156 locked = 1; 153 locked = 1;
@@ -174,7 +171,7 @@ xfs_swap_extents(
174 goto error0; 171 goto error0;
175 } 172 }
176 173
177 if (VN_CACHED(tvp) != 0) { 174 if (VN_CACHED(VFS_I(tip)) != 0) {
178 xfs_inval_cached_trace(tip, 0, -1, 0, -1); 175 xfs_inval_cached_trace(tip, 0, -1, 0, -1);
179 error = xfs_flushinval_pages(tip, 0, -1, 176 error = xfs_flushinval_pages(tip, 0, -1,
180 FI_REMAPF_LOCKED); 177 FI_REMAPF_LOCKED);
@@ -183,7 +180,7 @@ xfs_swap_extents(
183 } 180 }
184 181
185 /* Verify O_DIRECT for ftmp */ 182 /* Verify O_DIRECT for ftmp */
186 if (VN_CACHED(tvp) != 0) { 183 if (VN_CACHED(VFS_I(tip)) != 0) {
187 error = XFS_ERROR(EINVAL); 184 error = XFS_ERROR(EINVAL);
188 goto error0; 185 goto error0;
189 } 186 }
@@ -227,7 +224,7 @@ xfs_swap_extents(
227 * vop_read (or write in the case of autogrow) they block on the iolock 224 * vop_read (or write in the case of autogrow) they block on the iolock
228 * until we have switched the extents. 225 * until we have switched the extents.
229 */ 226 */
230 if (VN_MAPPED(vp)) { 227 if (VN_MAPPED(VFS_I(ip))) {
231 error = XFS_ERROR(EBUSY); 228 error = XFS_ERROR(EBUSY);
232 goto error0; 229 goto error0;
233 } 230 }
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 8da67d5717c8..efac8857ccb1 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1399,7 +1399,6 @@ xfs_itruncate_start(
1399 xfs_fsize_t last_byte; 1399 xfs_fsize_t last_byte;
1400 xfs_off_t toss_start; 1400 xfs_off_t toss_start;
1401 xfs_mount_t *mp; 1401 xfs_mount_t *mp;
1402 bhv_vnode_t *vp;
1403 int error = 0; 1402 int error = 0;
1404 1403
1405 ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); 1404 ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
@@ -1408,7 +1407,6 @@ xfs_itruncate_start(
1408 (flags == XFS_ITRUNC_MAYBE)); 1407 (flags == XFS_ITRUNC_MAYBE));
1409 1408
1410 mp = ip->i_mount; 1409 mp = ip->i_mount;
1411 vp = VFS_I(ip);
1412 1410
1413 /* wait for the completion of any pending DIOs */ 1411 /* wait for the completion of any pending DIOs */
1414 if (new_size < ip->i_size) 1412 if (new_size < ip->i_size)
@@ -1457,7 +1455,7 @@ xfs_itruncate_start(
1457 1455
1458#ifdef DEBUG 1456#ifdef DEBUG
1459 if (new_size == 0) { 1457 if (new_size == 0) {
1460 ASSERT(VN_CACHED(vp) == 0); 1458 ASSERT(VN_CACHED(VFS_I(ip)) == 0);
1461 } 1459 }
1462#endif 1460#endif
1463 return error; 1461 return error;
@@ -3465,7 +3463,6 @@ xfs_iflush_all(
3465 xfs_mount_t *mp) 3463 xfs_mount_t *mp)
3466{ 3464{
3467 xfs_inode_t *ip; 3465 xfs_inode_t *ip;
3468 bhv_vnode_t *vp;
3469 3466
3470 again: 3467 again:
3471 XFS_MOUNT_ILOCK(mp); 3468 XFS_MOUNT_ILOCK(mp);
@@ -3480,14 +3477,13 @@ xfs_iflush_all(
3480 continue; 3477 continue;
3481 } 3478 }
3482 3479
3483 vp = VFS_I(ip); 3480 if (!VFS_I(ip)) {
3484 if (!vp) {
3485 XFS_MOUNT_IUNLOCK(mp); 3481 XFS_MOUNT_IUNLOCK(mp);
3486 xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); 3482 xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
3487 goto again; 3483 goto again;
3488 } 3484 }
3489 3485
3490 ASSERT(vn_count(vp) == 0); 3486 ASSERT(vn_count(VFS_I(ip)) == 0);
3491 3487
3492 ip = ip->i_mnext; 3488 ip = ip->i_mnext;
3493 } while (ip != mp->m_inodes); 3489 } while (ip != mp->m_inodes);
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 4feda541e714..cf6754a3c5b3 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -59,7 +59,6 @@ xfs_bulkstat_one_iget(
59{ 59{
60 xfs_icdinode_t *dic; /* dinode core info pointer */ 60 xfs_icdinode_t *dic; /* dinode core info pointer */
61 xfs_inode_t *ip; /* incore inode pointer */ 61 xfs_inode_t *ip; /* incore inode pointer */
62 bhv_vnode_t *vp;
63 int error; 62 int error;
64 63
65 error = xfs_iget(mp, NULL, ino, 64 error = xfs_iget(mp, NULL, ino,
@@ -72,7 +71,6 @@ xfs_bulkstat_one_iget(
72 ASSERT(ip != NULL); 71 ASSERT(ip != NULL);
73 ASSERT(ip->i_blkno != (xfs_daddr_t)0); 72 ASSERT(ip->i_blkno != (xfs_daddr_t)0);
74 73
75 vp = VFS_I(ip);
76 dic = &ip->i_d; 74 dic = &ip->i_d;
77 75
78 /* xfs_iget returns the following without needing 76 /* xfs_iget returns the following without needing
@@ -85,7 +83,7 @@ xfs_bulkstat_one_iget(
85 buf->bs_uid = dic->di_uid; 83 buf->bs_uid = dic->di_uid;
86 buf->bs_gid = dic->di_gid; 84 buf->bs_gid = dic->di_gid;
87 buf->bs_size = dic->di_size; 85 buf->bs_size = dic->di_size;
88 vn_atime_to_bstime(vp, &buf->bs_atime); 86 vn_atime_to_bstime(VFS_I(ip), &buf->bs_atime);
89 buf->bs_mtime.tv_sec = dic->di_mtime.t_sec; 87 buf->bs_mtime.tv_sec = dic->di_mtime.t_sec;
90 buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec; 88 buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec;
91 buf->bs_ctime.tv_sec = dic->di_ctime.t_sec; 89 buf->bs_ctime.tv_sec = dic->di_ctime.t_sec;
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 38450f1fa2ac..974d3c0b8b6c 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -128,7 +128,6 @@ xfs_unmount_flush(
128 xfs_inode_t *rip = mp->m_rootip; 128 xfs_inode_t *rip = mp->m_rootip;
129 xfs_inode_t *rbmip; 129 xfs_inode_t *rbmip;
130 xfs_inode_t *rsumip = NULL; 130 xfs_inode_t *rsumip = NULL;
131 bhv_vnode_t *rvp = VFS_I(rip);
132 int error; 131 int error;
133 132
134 xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); 133 xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT);
@@ -167,7 +166,7 @@ xfs_unmount_flush(
167 if (error == EFSCORRUPTED) 166 if (error == EFSCORRUPTED)
168 goto fscorrupt_out2; 167 goto fscorrupt_out2;
169 168
170 if (vn_count(rvp) != 1 && !relocation) { 169 if (vn_count(VFS_I(rip)) != 1 && !relocation) {
171 xfs_iunlock(rip, XFS_ILOCK_EXCL); 170 xfs_iunlock(rip, XFS_ILOCK_EXCL);
172 return XFS_ERROR(EBUSY); 171 return XFS_ERROR(EBUSY);
173 } 172 }
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 077c86b6cb22..21da312dd8b2 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1160,7 +1160,6 @@ int
1160xfs_release( 1160xfs_release(
1161 xfs_inode_t *ip) 1161 xfs_inode_t *ip)
1162{ 1162{
1163 bhv_vnode_t *vp = VFS_I(ip);
1164 xfs_mount_t *mp = ip->i_mount; 1163 xfs_mount_t *mp = ip->i_mount;
1165 int error; 1164 int error;
1166 1165
@@ -1195,13 +1194,13 @@ xfs_release(
1195 * be exposed to that problem. 1194 * be exposed to that problem.
1196 */ 1195 */
1197 truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED); 1196 truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED);
1198 if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0) 1197 if (truncated && VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > 0)
1199 xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE); 1198 xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE);
1200 } 1199 }
1201 1200
1202 if (ip->i_d.di_nlink != 0) { 1201 if (ip->i_d.di_nlink != 0) {
1203 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && 1202 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) &&
1204 ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || 1203 ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 ||
1205 ip->i_delayed_blks > 0)) && 1204 ip->i_delayed_blks > 0)) &&
1206 (ip->i_df.if_flags & XFS_IFEXTENTS)) && 1205 (ip->i_df.if_flags & XFS_IFEXTENTS)) &&
1207 (!(ip->i_d.di_flags & 1206 (!(ip->i_d.di_flags &
@@ -1227,7 +1226,6 @@ int
1227xfs_inactive( 1226xfs_inactive(
1228 xfs_inode_t *ip) 1227 xfs_inode_t *ip)
1229{ 1228{
1230 bhv_vnode_t *vp = VFS_I(ip);
1231 xfs_bmap_free_t free_list; 1229 xfs_bmap_free_t free_list;
1232 xfs_fsblock_t first_block; 1230 xfs_fsblock_t first_block;
1233 int committed; 1231 int committed;
@@ -1242,7 +1240,7 @@ xfs_inactive(
1242 * If the inode is already free, then there can be nothing 1240 * If the inode is already free, then there can be nothing
1243 * to clean up here. 1241 * to clean up here.
1244 */ 1242 */
1245 if (ip->i_d.di_mode == 0 || VN_BAD(vp)) { 1243 if (ip->i_d.di_mode == 0 || VN_BAD(VFS_I(ip))) {
1246 ASSERT(ip->i_df.if_real_bytes == 0); 1244 ASSERT(ip->i_df.if_real_bytes == 0);
1247 ASSERT(ip->i_df.if_broot_bytes == 0); 1245 ASSERT(ip->i_df.if_broot_bytes == 0);
1248 return VN_INACTIVE_CACHE; 1246 return VN_INACTIVE_CACHE;
@@ -1272,7 +1270,7 @@ xfs_inactive(
1272 1270
1273 if (ip->i_d.di_nlink != 0) { 1271 if (ip->i_d.di_nlink != 0) {
1274 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && 1272 if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) &&
1275 ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || 1273 ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 ||
1276 ip->i_delayed_blks > 0)) && 1274 ip->i_delayed_blks > 0)) &&
1277 (ip->i_df.if_flags & XFS_IFEXTENTS) && 1275 (ip->i_df.if_flags & XFS_IFEXTENTS) &&
1278 (!(ip->i_d.di_flags & 1276 (!(ip->i_d.di_flags &
@@ -2793,14 +2791,13 @@ int
2793xfs_reclaim( 2791xfs_reclaim(
2794 xfs_inode_t *ip) 2792 xfs_inode_t *ip)
2795{ 2793{
2796 bhv_vnode_t *vp = VFS_I(ip);
2797 2794
2798 xfs_itrace_entry(ip); 2795 xfs_itrace_entry(ip);
2799 2796
2800 ASSERT(!VN_MAPPED(vp)); 2797 ASSERT(!VN_MAPPED(VFS_I(ip)));
2801 2798
2802 /* bad inode, get out here ASAP */ 2799 /* bad inode, get out here ASAP */
2803 if (VN_BAD(vp)) { 2800 if (VN_BAD(VFS_I(ip))) {
2804 xfs_ireclaim(ip); 2801 xfs_ireclaim(ip);
2805 return 0; 2802 return 0;
2806 } 2803 }
@@ -2837,7 +2834,7 @@ xfs_reclaim(
2837 XFS_MOUNT_ILOCK(mp); 2834 XFS_MOUNT_ILOCK(mp);
2838 spin_lock(&ip->i_flags_lock); 2835 spin_lock(&ip->i_flags_lock);
2839 __xfs_iflags_set(ip, XFS_IRECLAIMABLE); 2836 __xfs_iflags_set(ip, XFS_IRECLAIMABLE);
2840 vp->i_private = NULL; 2837 VFS_I(ip)->i_private = NULL;
2841 ip->i_vnode = NULL; 2838 ip->i_vnode = NULL;
2842 spin_unlock(&ip->i_flags_lock); 2839 spin_unlock(&ip->i_flags_lock);
2843 list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); 2840 list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
@@ -3241,7 +3238,6 @@ xfs_free_file_space(
3241 xfs_off_t len, 3238 xfs_off_t len,
3242 int attr_flags) 3239 int attr_flags)
3243{ 3240{
3244 bhv_vnode_t *vp;
3245 int committed; 3241 int committed;
3246 int done; 3242 int done;
3247 xfs_off_t end_dmi_offset; 3243 xfs_off_t end_dmi_offset;
@@ -3261,7 +3257,6 @@ xfs_free_file_space(
3261 xfs_trans_t *tp; 3257 xfs_trans_t *tp;
3262 int need_iolock = 1; 3258 int need_iolock = 1;
3263 3259
3264 vp = VFS_I(ip);
3265 mp = ip->i_mount; 3260 mp = ip->i_mount;
3266 3261
3267 xfs_itrace_entry(ip); 3262 xfs_itrace_entry(ip);
@@ -3298,7 +3293,7 @@ xfs_free_file_space(
3298 rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); 3293 rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE);
3299 ioffset = offset & ~(rounding - 1); 3294 ioffset = offset & ~(rounding - 1);
3300 3295
3301 if (VN_CACHED(vp) != 0) { 3296 if (VN_CACHED(VFS_I(ip)) != 0) {
3302 xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1); 3297 xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1);
3303 error = xfs_flushinval_pages(ip, ioffset, -1, FI_REMAPF_LOCKED); 3298 error = xfs_flushinval_pages(ip, ioffset, -1, FI_REMAPF_LOCKED);
3304 if (error) 3299 if (error)