aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2005-09-02 02:56:14 -0400
committerNathan Scott <nathans@sgi.com>2005-09-02 02:56:14 -0400
commit592cb26bda6fe69838529acf71e50a6dee7acbb4 (patch)
tree06558d42a069d0faeb398d81016c33448960d009 /fs
parent760dea671ea9c5b8c732d76d09673d6d052a186f (diff)
[XFS] remove unessecary vnode flags
SGI-PV: 934766 SGI-Modid: xfs-linux:xfs-kern:196852a Signed-off-by: Christoph Hellwig <hch@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c59
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h4
-rw-r--r--fs/xfs/xfs_iget.c11
3 files changed, 1 insertions, 73 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index ad16af38e965..654da98de2a5 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -78,10 +78,6 @@ vn_reclaim(
78 } 78 }
79 ASSERT(vp->v_fbhv == NULL); 79 ASSERT(vp->v_fbhv == NULL);
80 80
81 VN_LOCK(vp);
82 vp->v_flag &= (VRECLM|VWAIT);
83 VN_UNLOCK(vp, 0);
84
85 vp->v_fbhv = NULL; 81 vp->v_fbhv = NULL;
86 82
87#ifdef XFS_VNODE_TRACE 83#ifdef XFS_VNODE_TRACE
@@ -92,31 +88,6 @@ vn_reclaim(
92 return 0; 88 return 0;
93} 89}
94 90
95STATIC void
96vn_wakeup(
97 struct vnode *vp)
98{
99 VN_LOCK(vp);
100 if (vp->v_flag & VWAIT)
101 sv_broadcast(vptosync(vp));
102 vp->v_flag &= ~(VRECLM|VWAIT|VMODIFIED);
103 VN_UNLOCK(vp, 0);
104}
105
106int
107vn_wait(
108 struct vnode *vp)
109{
110 VN_LOCK(vp);
111 if (vp->v_flag & (VINACT | VRECLM)) {
112 vp->v_flag |= VWAIT;
113 sv_wait(vptosync(vp), PINOD, &vp->v_lock, 0);
114 return 1;
115 }
116 VN_UNLOCK(vp, 0);
117 return 0;
118}
119
120struct vnode * 91struct vnode *
121vn_initialize( 92vn_initialize(
122 struct inode *inode) 93 struct inode *inode)
@@ -221,7 +192,6 @@ vn_purge(
221{ 192{
222 vn_trace_entry(vp, "vn_purge", (inst_t *)__return_address); 193 vn_trace_entry(vp, "vn_purge", (inst_t *)__return_address);
223 194
224again:
225 /* 195 /*
226 * Check whether vp has already been reclaimed since our caller 196 * Check whether vp has already been reclaimed since our caller
227 * sampled its version while holding a filesystem cache lock that 197 * sampled its version while holding a filesystem cache lock that
@@ -234,19 +204,6 @@ again:
234 } 204 }
235 205
236 /* 206 /*
237 * If vp is being reclaimed or inactivated, wait until it is inert,
238 * then proceed. Can't assume that vnode is actually reclaimed
239 * just because the reclaimed flag is asserted -- a vn_alloc
240 * reclaim can fail.
241 */
242 if (vp->v_flag & (VINACT | VRECLM)) {
243 ASSERT(vn_count(vp) == 0);
244 vp->v_flag |= VWAIT;
245 sv_wait(vptosync(vp), PINOD, &vp->v_lock, 0);
246 goto again;
247 }
248
249 /*
250 * Another process could have raced in and gotten this vnode... 207 * Another process could have raced in and gotten this vnode...
251 */ 208 */
252 if (vn_count(vp) > 0) { 209 if (vn_count(vp) > 0) {
@@ -255,7 +212,6 @@ again:
255 } 212 }
256 213
257 XFS_STATS_DEC(vn_active); 214 XFS_STATS_DEC(vn_active);
258 vp->v_flag |= VRECLM;
259 VN_UNLOCK(vp, 0); 215 VN_UNLOCK(vp, 0);
260 216
261 /* 217 /*
@@ -266,11 +222,6 @@ again:
266 */ 222 */
267 if (vn_reclaim(vp) != 0) 223 if (vn_reclaim(vp) != 0)
268 panic("vn_purge: cannot reclaim"); 224 panic("vn_purge: cannot reclaim");
269
270 /*
271 * Wakeup anyone waiting for vp to be reclaimed.
272 */
273 vn_wakeup(vp);
274} 225}
275 226
276/* 227/*
@@ -315,11 +266,6 @@ vn_rele(
315 * return. 266 * return.
316 */ 267 */
317 if (!vcnt) { 268 if (!vcnt) {
318 /*
319 * As soon as we turn this on, noone can find us in vn_get
320 * until we turn off VINACT or VRECLM
321 */
322 vp->v_flag |= VINACT;
323 VN_UNLOCK(vp, 0); 269 VN_UNLOCK(vp, 0);
324 270
325 /* 271 /*
@@ -330,10 +276,7 @@ vn_rele(
330 VOP_INACTIVE(vp, NULL, cache); 276 VOP_INACTIVE(vp, NULL, cache);
331 277
332 VN_LOCK(vp); 278 VN_LOCK(vp);
333 if (vp->v_flag & VWAIT) 279 vp->v_flag &= ~VMODIFIED;
334 sv_broadcast(vptosync(vp));
335
336 vp->v_flag &= ~(VINACT|VWAIT|VRECLM|VMODIFIED);
337 } 280 }
338 281
339 VN_UNLOCK(vp, 0); 282 VN_UNLOCK(vp, 0);
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index bc9ed722ba1e..4a74569a5690 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -135,9 +135,6 @@ typedef enum {
135/* 135/*
136 * Vnode flags. 136 * Vnode flags.
137 */ 137 */
138#define VINACT 0x1 /* vnode is being inactivated */
139#define VRECLM 0x2 /* vnode is being reclaimed */
140#define VWAIT 0x4 /* waiting for VINACT/VRECLM to end */
141#define VMODIFIED 0x8 /* XFS inode state possibly differs */ 138#define VMODIFIED 0x8 /* XFS inode state possibly differs */
142 /* to the Linux inode state. */ 139 /* to the Linux inode state. */
143 140
@@ -489,7 +486,6 @@ typedef struct vattr {
489 (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID) 486 (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID)
490 487
491extern void vn_init(void); 488extern void vn_init(void);
492extern int vn_wait(struct vnode *);
493extern vnode_t *vn_initialize(struct inode *); 489extern vnode_t *vn_initialize(struct inode *);
494 490
495/* 491/*
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index d3da00045f26..fa796910f3aa 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -505,7 +505,6 @@ xfs_iget(
505 vnode_t *vp = NULL; 505 vnode_t *vp = NULL;
506 int error; 506 int error;
507 507
508retry:
509 XFS_STATS_INC(xs_ig_attempts); 508 XFS_STATS_INC(xs_ig_attempts);
510 509
511 if ((inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino))) { 510 if ((inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino))) {
@@ -526,16 +525,6 @@ inode_allocate:
526 iput(inode); 525 iput(inode);
527 } 526 }
528 } else { 527 } else {
529 /* These are true if the inode is in inactive or
530 * reclaim. The linux inode is about to go away,
531 * wait for that path to finish, and try again.
532 */
533 if (vp->v_flag & (VINACT | VRECLM)) {
534 vn_wait(vp);
535 iput(inode);
536 goto retry;
537 }
538
539 if (is_bad_inode(inode)) { 528 if (is_bad_inode(inode)) {
540 iput(inode); 529 iput(inode);
541 return EIO; 530 return EIO;