[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>
This commit is contained in:

committed by
Tim Shimmin

parent
424ea91ba6
commit
d3cf209476
@@ -35,7 +35,7 @@ fs_tosspages(
|
||||
truncate_inode_pages(ip->i_mapping, first);
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
fs_flushinval_pages(
|
||||
bhv_desc_t *bdp,
|
||||
xfs_off_t first,
|
||||
@@ -44,13 +44,16 @@ fs_flushinval_pages(
|
||||
{
|
||||
bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
|
||||
struct inode *ip = vn_to_inode(vp);
|
||||
int ret = 0;
|
||||
|
||||
if (VN_CACHED(vp)) {
|
||||
if (VN_TRUNC(vp))
|
||||
VUNTRUNCATE(vp);
|
||||
filemap_write_and_wait(ip->i_mapping);
|
||||
truncate_inode_pages(ip->i_mapping, first);
|
||||
ret = filemap_write_and_wait(ip->i_mapping);
|
||||
if (!ret)
|
||||
truncate_inode_pages(ip->i_mapping, first);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -63,14 +66,18 @@ fs_flush_pages(
|
||||
{
|
||||
bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
|
||||
struct inode *ip = vn_to_inode(vp);
|
||||
int ret = 0;
|
||||
int ret2;
|
||||
|
||||
if (VN_DIRTY(vp)) {
|
||||
if (VN_TRUNC(vp))
|
||||
VUNTRUNCATE(vp);
|
||||
filemap_fdatawrite(ip->i_mapping);
|
||||
ret = filemap_fdatawrite(ip->i_mapping);
|
||||
if (flags & XFS_B_ASYNC)
|
||||
return 0;
|
||||
filemap_fdatawait(ip->i_mapping);
|
||||
return ret;
|
||||
ret2 = filemap_fdatawait(ip->i_mapping);
|
||||
if (!ret)
|
||||
ret = ret2;
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user