Commit 40165e27 authored by Brian Foster's avatar Brian Foster Committed by Ben Myers

xfs: make xfs_free_eofblocks() non-static, return EAGAIN on trylock failure

Turn xfs_free_eofblocks() into a non-static function, return EAGAIN to
indicate trylock failure and make sure this error is not propagated in
xfs_release().
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent 72b53efa
...@@ -151,7 +151,7 @@ xfs_readlink( ...@@ -151,7 +151,7 @@ xfs_readlink(
* when the link count isn't zero and by xfs_dm_punch_hole() when * when the link count isn't zero and by xfs_dm_punch_hole() when
* punching a hole to EOF. * punching a hole to EOF.
*/ */
STATIC int int
xfs_free_eofblocks( xfs_free_eofblocks(
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_inode_t *ip, xfs_inode_t *ip,
...@@ -200,7 +200,7 @@ xfs_free_eofblocks( ...@@ -200,7 +200,7 @@ xfs_free_eofblocks(
if (need_iolock) { if (need_iolock) {
if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) {
xfs_trans_cancel(tp, 0); xfs_trans_cancel(tp, 0);
return 0; return EAGAIN;
} }
} }
...@@ -463,7 +463,7 @@ xfs_release( ...@@ -463,7 +463,7 @@ xfs_release(
return 0; return 0;
error = xfs_free_eofblocks(mp, ip, true); error = xfs_free_eofblocks(mp, ip, true);
if (error) if (error && error != EAGAIN)
return error; return error;
/* delalloc blocks after truncation means it really is dirty */ /* delalloc blocks after truncation means it really is dirty */
......
...@@ -57,5 +57,6 @@ int xfs_flush_pages(struct xfs_inode *ip, xfs_off_t first, ...@@ -57,5 +57,6 @@ int xfs_flush_pages(struct xfs_inode *ip, xfs_off_t first,
int xfs_wait_on_pages(struct xfs_inode *ip, xfs_off_t first, xfs_off_t last); int xfs_wait_on_pages(struct xfs_inode *ip, xfs_off_t first, xfs_off_t last);
int xfs_zero_eof(struct xfs_inode *, xfs_off_t, xfs_fsize_t); int xfs_zero_eof(struct xfs_inode *, xfs_off_t, xfs_fsize_t);
int xfs_free_eofblocks(struct xfs_mount *, struct xfs_inode *, bool);
#endif /* _XFS_VNODEOPS_H */ #endif /* _XFS_VNODEOPS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment