aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_fs_subr.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@sgi.com>2007-05-07 23:49:27 -0400
committerTim Shimmin <tes@sgi.com>2007-05-07 23:49:27 -0400
commitd3cf209476b72c83907a412b6708c5e498410aa7 (patch)
tree5e7a85751ae03b9eb3110e1cfc147b3492ae0fa5 /fs/xfs/linux-2.6/xfs_fs_subr.c
parent424ea91ba61c1cdc2dac68576c97030cbf47d84f (diff)
[XFS] propogate return codes from flush routines
This patch handles error return values in fs_flush_pages and fs_flushinval_pages. It changes the prototype of fs_flushinval_pages so we can propogate the errors and handle them at higher layers. I also modified xfs_itruncate_start so that it could propogate the error further. SGI-PV: 961990 SGI-Modid: xfs-linux-melb:xfs-kern:28231a Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Stewart Smith <stewart@flamingspork.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_fs_subr.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_fs_subr.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c
index dc0562828e76..2eb87cd082af 100644
--- a/fs/xfs/linux-2.6/xfs_fs_subr.c
+++ b/fs/xfs/linux-2.6/xfs_fs_subr.c
@@ -35,7 +35,7 @@ fs_tosspages(
35 truncate_inode_pages(ip->i_mapping, first); 35 truncate_inode_pages(ip->i_mapping, first);
36} 36}
37 37
38void 38int
39fs_flushinval_pages( 39fs_flushinval_pages(
40 bhv_desc_t *bdp, 40 bhv_desc_t *bdp,
41 xfs_off_t first, 41 xfs_off_t first,
@@ -44,13 +44,16 @@ fs_flushinval_pages(
44{ 44{
45 bhv_vnode_t *vp = BHV_TO_VNODE(bdp); 45 bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
46 struct inode *ip = vn_to_inode(vp); 46 struct inode *ip = vn_to_inode(vp);
47 int ret = 0;
47 48
48 if (VN_CACHED(vp)) { 49 if (VN_CACHED(vp)) {
49 if (VN_TRUNC(vp)) 50 if (VN_TRUNC(vp))
50 VUNTRUNCATE(vp); 51 VUNTRUNCATE(vp);
51 filemap_write_and_wait(ip->i_mapping); 52 ret = filemap_write_and_wait(ip->i_mapping);
52 truncate_inode_pages(ip->i_mapping, first); 53 if (!ret)
54 truncate_inode_pages(ip->i_mapping, first);
53 } 55 }
56 return ret;
54} 57}
55 58
56int 59int
@@ -63,14 +66,18 @@ fs_flush_pages(
63{ 66{
64 bhv_vnode_t *vp = BHV_TO_VNODE(bdp); 67 bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
65 struct inode *ip = vn_to_inode(vp); 68 struct inode *ip = vn_to_inode(vp);
69 int ret = 0;
70 int ret2;
66 71
67 if (VN_DIRTY(vp)) { 72 if (VN_DIRTY(vp)) {
68 if (VN_TRUNC(vp)) 73 if (VN_TRUNC(vp))
69 VUNTRUNCATE(vp); 74 VUNTRUNCATE(vp);
70 filemap_fdatawrite(ip->i_mapping); 75 ret = filemap_fdatawrite(ip->i_mapping);
71 if (flags & XFS_B_ASYNC) 76 if (flags & XFS_B_ASYNC)
72 return 0; 77 return ret;
73 filemap_fdatawait(ip->i_mapping); 78 ret2 = filemap_fdatawait(ip->i_mapping);
79 if (!ret)
80 ret = ret2;
74 } 81 }
75 return 0; 82 return ret;
76} 83}