summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/aops.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-18 09:43:56 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-18 09:43:56 +0100
commite19b9137142988bec5a76c5f8bdf12a77ea802b0 (patch)
treeb36c83fa93da7f18c1331252fb82a87431697443 /fs/gfs2/aops.c
parent2fae6a860ca9adb0c881f6dcd633df775c2520e9 (diff)
parente40d641099213145a034981e646dc2180a488152 (diff)
Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next
Conflicts: drivers/gpu/drm/i915/Makefile Makefile cleanup in drm-intel-next conflicts with a build-fix to move intel_opregion under CONFIG_ACPI. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'fs/gfs2/aops.c')
-rw-r--r--fs/gfs2/aops.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 73f3e4ee403..49436fa7cd4 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -1032,8 +1032,9 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
unmap_shared_mapping_range(ip->i_inode.i_mapping, offset, len);
rv = filemap_write_and_wait_range(mapping, lstart, end);
if (rv)
- return rv;
- truncate_inode_pages_range(mapping, lstart, end);
+ goto out;
+ if (rw == WRITE)
+ truncate_inode_pages_range(mapping, lstart, end);
}
rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
@@ -1080,30 +1081,22 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
bh = bh->b_this_page;
} while(bh != head);
spin_unlock(&sdp->sd_ail_lock);
- gfs2_log_unlock(sdp);
head = bh = page_buffers(page);
do {
- gfs2_log_lock(sdp);
bd = bh->b_private;
if (bd) {
gfs2_assert_warn(sdp, bd->bd_bh == bh);
- if (!list_empty(&bd->bd_list)) {
- if (!buffer_pinned(bh))
- list_del_init(&bd->bd_list);
- else
- bd = NULL;
- }
- if (bd)
- bd->bd_bh = NULL;
+ if (!list_empty(&bd->bd_list))
+ list_del_init(&bd->bd_list);
+ bd->bd_bh = NULL;
bh->b_private = NULL;
- }
- gfs2_log_unlock(sdp);
- if (bd)
kmem_cache_free(gfs2_bufdata_cachep, bd);
+ }
bh = bh->b_this_page;
} while (bh != head);
+ gfs2_log_unlock(sdp);
return try_to_free_buffers(page);