aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-28 20:58:01 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 20:40:00 -0400
commit739bfb2a7dfa369324f74aad1d020d6e0775e4f0 (patch)
tree8fbe3e739e0d550137e3f148a36ce5c083f5ef2c /fs/xfs/linux-2.6/xfs_super.c
parent993386c19afa53fa54d00c7721e56ba820b3400d (diff)
[XFS] call common xfs vnode-level helpers directly and remove vnode operations
SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29493a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 2fbf24a6cf58..42d6ed1788ff 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -46,6 +46,7 @@
46#include "xfs_attr.h" 46#include "xfs_attr.h"
47#include "xfs_buf_item.h" 47#include "xfs_buf_item.h"
48#include "xfs_utils.h" 48#include "xfs_utils.h"
49#include "xfs_vnodeops.h"
49#include "xfs_version.h" 50#include "xfs_version.h"
50 51
51#include <linux/namei.h> 52#include <linux/namei.h>
@@ -203,16 +204,15 @@ void
203xfs_initialize_vnode( 204xfs_initialize_vnode(
204 bhv_desc_t *bdp, 205 bhv_desc_t *bdp,
205 bhv_vnode_t *vp, 206 bhv_vnode_t *vp,
206 bhv_desc_t *inode_bhv, 207 struct xfs_inode *ip,
207 int unlock) 208 int unlock)
208{ 209{
209 xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
210 struct inode *inode = vn_to_inode(vp); 210 struct inode *inode = vn_to_inode(vp);
211 211
212 if (!inode_bhv->bd_vobj) { 212 if (!ip->i_vnode) {
213 vp->v_vfsp = bhvtovfs(bdp); 213 vp->v_vfsp = bhvtovfs(bdp);
214 bhv_desc_init(inode_bhv, ip, vp, &xfs_vnodeops); 214 ip->i_vnode = vp;
215 bhv_insert(VN_BHV_HEAD(vp), inode_bhv); 215 inode->i_private = ip;
216 } 216 }
217 217
218 /* 218 /*
@@ -402,19 +402,23 @@ xfs_fs_write_inode(
402 struct inode *inode, 402 struct inode *inode,
403 int sync) 403 int sync)
404{ 404{
405 bhv_vnode_t *vp = vn_from_inode(inode);
406 int error = 0, flags = FLUSH_INODE; 405 int error = 0, flags = FLUSH_INODE;
407 406
408 if (vp) { 407 vn_trace_entry(vn_from_inode(inode), __FUNCTION__,
409 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 408 (inst_t *)__return_address);
410 if (sync) { 409 if (sync) {
411 filemap_fdatawait(inode->i_mapping); 410 filemap_fdatawait(inode->i_mapping);
412 flags |= FLUSH_SYNC; 411 flags |= FLUSH_SYNC;
413 }
414 error = bhv_vop_iflush(vp, flags);
415 if (error == EAGAIN)
416 error = sync? bhv_vop_iflush(vp, flags | FLUSH_LOG) : 0;
417 } 412 }
413 error = xfs_inode_flush(XFS_I(inode), flags);
414 if (error == EAGAIN) {
415 if (sync)
416 error = xfs_inode_flush(XFS_I(inode),
417 flags | FLUSH_LOG);
418 else
419 error = 0;
420 }
421
418 return -error; 422 return -error;
419} 423}
420 424
@@ -435,18 +439,18 @@ xfs_fs_clear_inode(
435 * This can happen because xfs_iget_core calls xfs_idestroy if we 439 * This can happen because xfs_iget_core calls xfs_idestroy if we
436 * find an inode with di_mode == 0 but without IGET_CREATE set. 440 * find an inode with di_mode == 0 but without IGET_CREATE set.
437 */ 441 */
438 if (VNHEAD(vp)) 442 if (XFS_I(inode))
439 bhv_vop_inactive(vp, NULL); 443 xfs_inactive(XFS_I(inode));
440 444
441 VN_LOCK(vp); 445 VN_LOCK(vp);
442 vp->v_flag &= ~VMODIFIED; 446 vp->v_flag &= ~VMODIFIED;
443 VN_UNLOCK(vp, 0); 447 VN_UNLOCK(vp, 0);
444 448
445 if (VNHEAD(vp)) 449 if (XFS_I(inode))
446 if (bhv_vop_reclaim(vp)) 450 if (xfs_reclaim(XFS_I(inode)))
447 panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp); 451 panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp);
448 452
449 ASSERT(VNHEAD(vp) == NULL); 453 ASSERT(XFS_I(inode) == NULL);
450 454
451#ifdef XFS_VNODE_TRACE 455#ifdef XFS_VNODE_TRACE
452 ktrace_free(vp->v_trace); 456 ktrace_free(vp->v_trace);