diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-03-05 21:46:37 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-17 21:41:04 -0400 |
commit | dcf49cc5cfbbc0070ad4307428f8282dc7e04e58 (patch) | |
tree | ca789975aade7e70fed8642eecd6d11e81eff748 /fs/xfs/linux-2.6/xfs_lrw.c | |
parent | ef1f5e7ad38e5414d016983a8cc5a8db7654a61d (diff) |
[XFS] cleanup vnode use in xfs_lrw.c
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30551a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_lrw.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 01a8f26e1b17..1d95dca96cfe 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -176,7 +176,6 @@ xfs_read( | |||
176 | { | 176 | { |
177 | struct file *file = iocb->ki_filp; | 177 | struct file *file = iocb->ki_filp; |
178 | struct inode *inode = file->f_mapping->host; | 178 | struct inode *inode = file->f_mapping->host; |
179 | bhv_vnode_t *vp = XFS_ITOV(ip); | ||
180 | xfs_mount_t *mp = ip->i_mount; | 179 | xfs_mount_t *mp = ip->i_mount; |
181 | size_t size = 0; | 180 | size_t size = 0; |
182 | ssize_t ret = 0; | 181 | ssize_t ret = 0; |
@@ -242,7 +241,7 @@ xfs_read( | |||
242 | } | 241 | } |
243 | 242 | ||
244 | if (unlikely(ioflags & IO_ISDIRECT)) { | 243 | if (unlikely(ioflags & IO_ISDIRECT)) { |
245 | if (VN_CACHED(vp)) | 244 | if (inode->i_mapping->nrpages) |
246 | ret = xfs_flushinval_pages(ip, (*offset & PAGE_CACHE_MASK), | 245 | ret = xfs_flushinval_pages(ip, (*offset & PAGE_CACHE_MASK), |
247 | -1, FI_REMAPF_LOCKED); | 246 | -1, FI_REMAPF_LOCKED); |
248 | mutex_unlock(&inode->i_mutex); | 247 | mutex_unlock(&inode->i_mutex); |
@@ -571,7 +570,6 @@ xfs_write( | |||
571 | struct file *file = iocb->ki_filp; | 570 | struct file *file = iocb->ki_filp; |
572 | struct address_space *mapping = file->f_mapping; | 571 | struct address_space *mapping = file->f_mapping; |
573 | struct inode *inode = mapping->host; | 572 | struct inode *inode = mapping->host; |
574 | bhv_vnode_t *vp = XFS_ITOV(xip); | ||
575 | unsigned long segs = nsegs; | 573 | unsigned long segs = nsegs; |
576 | xfs_mount_t *mp; | 574 | xfs_mount_t *mp; |
577 | ssize_t ret = 0, error = 0; | 575 | ssize_t ret = 0, error = 0; |
@@ -658,7 +656,7 @@ start: | |||
658 | return XFS_ERROR(-EINVAL); | 656 | return XFS_ERROR(-EINVAL); |
659 | } | 657 | } |
660 | 658 | ||
661 | if (!need_i_mutex && (VN_CACHED(vp) || pos > xip->i_size)) { | 659 | if (!need_i_mutex && (mapping->nrpages || pos > xip->i_size)) { |
662 | xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock); | 660 | xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock); |
663 | iolock = XFS_IOLOCK_EXCL; | 661 | iolock = XFS_IOLOCK_EXCL; |
664 | need_i_mutex = 1; | 662 | need_i_mutex = 1; |
@@ -720,7 +718,7 @@ retry: | |||
720 | current->backing_dev_info = mapping->backing_dev_info; | 718 | current->backing_dev_info = mapping->backing_dev_info; |
721 | 719 | ||
722 | if ((ioflags & IO_ISDIRECT)) { | 720 | if ((ioflags & IO_ISDIRECT)) { |
723 | if (VN_CACHED(vp)) { | 721 | if (mapping->nrpages) { |
724 | WARN_ON(need_i_mutex == 0); | 722 | WARN_ON(need_i_mutex == 0); |
725 | xfs_inval_cached_trace(xip, pos, -1, | 723 | xfs_inval_cached_trace(xip, pos, -1, |
726 | (pos & PAGE_CACHE_MASK), -1); | 724 | (pos & PAGE_CACHE_MASK), -1); |