Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89388
b: refs/heads/master
c: dcf49cc
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Lachlan McIlroy committed Apr 18, 2008
1 parent 453fe8f commit 4d8c19e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef1f5e7ad38e5414d016983a8cc5a8db7654a61d
refs/heads/master: dcf49cc5cfbbc0070ad4307428f8282dc7e04e58
8 changes: 3 additions & 5 deletions trunk/fs/xfs/linux-2.6/xfs_lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ xfs_read(
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
bhv_vnode_t *vp = XFS_ITOV(ip);
xfs_mount_t *mp = ip->i_mount;
size_t size = 0;
ssize_t ret = 0;
Expand Down Expand Up @@ -242,7 +241,7 @@ xfs_read(
}

if (unlikely(ioflags & IO_ISDIRECT)) {
if (VN_CACHED(vp))
if (inode->i_mapping->nrpages)
ret = xfs_flushinval_pages(ip, (*offset & PAGE_CACHE_MASK),
-1, FI_REMAPF_LOCKED);
mutex_unlock(&inode->i_mutex);
Expand Down Expand Up @@ -571,7 +570,6 @@ xfs_write(
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
struct inode *inode = mapping->host;
bhv_vnode_t *vp = XFS_ITOV(xip);
unsigned long segs = nsegs;
xfs_mount_t *mp;
ssize_t ret = 0, error = 0;
Expand Down Expand Up @@ -658,7 +656,7 @@ xfs_write(
return XFS_ERROR(-EINVAL);
}

if (!need_i_mutex && (VN_CACHED(vp) || pos > xip->i_size)) {
if (!need_i_mutex && (mapping->nrpages || pos > xip->i_size)) {
xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock);
iolock = XFS_IOLOCK_EXCL;
need_i_mutex = 1;
Expand Down Expand Up @@ -720,7 +718,7 @@ xfs_write(
current->backing_dev_info = mapping->backing_dev_info;

if ((ioflags & IO_ISDIRECT)) {
if (VN_CACHED(vp)) {
if (mapping->nrpages) {
WARN_ON(need_i_mutex == 0);
xfs_inval_cached_trace(xip, pos, -1,
(pos & PAGE_CACHE_MASK), -1);
Expand Down

0 comments on commit 4d8c19e

Please sign in to comment.