diff options
author | Brian Foster <bfoster@redhat.com> | 2012-11-06 09:50:41 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-11-08 16:24:26 -0500 |
commit | 40165e27617e2a98bf8588001d2f2872fae2fee2 (patch) | |
tree | fa67853de394ffe6d63aa981836a1e780def25f2 /fs/xfs | |
parent | 72b53efa4a6125a4c334871c58268c430605819a (diff) |
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: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index c4c153900205..c2ddd7a43942 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -151,7 +151,7 @@ xfs_readlink( | |||
151 | * when the link count isn't zero and by xfs_dm_punch_hole() when | 151 | * when the link count isn't zero and by xfs_dm_punch_hole() when |
152 | * punching a hole to EOF. | 152 | * punching a hole to EOF. |
153 | */ | 153 | */ |
154 | STATIC int | 154 | int |
155 | xfs_free_eofblocks( | 155 | xfs_free_eofblocks( |
156 | xfs_mount_t *mp, | 156 | xfs_mount_t *mp, |
157 | xfs_inode_t *ip, | 157 | xfs_inode_t *ip, |
@@ -200,7 +200,7 @@ xfs_free_eofblocks( | |||
200 | if (need_iolock) { | 200 | if (need_iolock) { |
201 | if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { | 201 | if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { |
202 | xfs_trans_cancel(tp, 0); | 202 | xfs_trans_cancel(tp, 0); |
203 | return 0; | 203 | return EAGAIN; |
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
@@ -463,7 +463,7 @@ xfs_release( | |||
463 | return 0; | 463 | return 0; |
464 | 464 | ||
465 | error = xfs_free_eofblocks(mp, ip, true); | 465 | error = xfs_free_eofblocks(mp, ip, true); |
466 | if (error) | 466 | if (error && error != EAGAIN) |
467 | return error; | 467 | return error; |
468 | 468 | ||
469 | /* delalloc blocks after truncation means it really is dirty */ | 469 | /* delalloc blocks after truncation means it really is dirty */ |
diff --git a/fs/xfs/xfs_vnodeops.h b/fs/xfs/xfs_vnodeops.h index 447e146b2ba6..52fafc416a0c 100644 --- a/fs/xfs/xfs_vnodeops.h +++ b/fs/xfs/xfs_vnodeops.h | |||
@@ -57,5 +57,6 @@ int xfs_flush_pages(struct xfs_inode *ip, xfs_off_t first, | |||
57 | int xfs_wait_on_pages(struct xfs_inode *ip, xfs_off_t first, xfs_off_t last); | 57 | int xfs_wait_on_pages(struct xfs_inode *ip, xfs_off_t first, xfs_off_t last); |
58 | 58 | ||
59 | int xfs_zero_eof(struct xfs_inode *, xfs_off_t, xfs_fsize_t); | 59 | int xfs_zero_eof(struct xfs_inode *, xfs_off_t, xfs_fsize_t); |
60 | int xfs_free_eofblocks(struct xfs_mount *, struct xfs_inode *, bool); | ||
60 | 61 | ||
61 | #endif /* _XFS_VNODEOPS_H */ | 62 | #endif /* _XFS_VNODEOPS_H */ |