diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-08-23 04:28:06 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-10-11 22:14:59 -0400 |
commit | 61551f1ee536289084a4a8f1c4f187e2f371c440 (patch) | |
tree | b160fd8779bafb6ec8e99f928bcb3e222a91817e /fs/xfs/xfs_buf.c | |
parent | 5a8ee6bafdd0ab8555adceac8b2cec539a552a1f (diff) |
xfs: call xfs_buf_delwri_queue directly
Unify the ways we add buffers to the delwri queue by always calling
xfs_buf_delwri_queue directly. The xfs_bdwrite functions is removed and
opencoded in its callers, and the two places setting XBF_DELWRI while a
buffer is locked and expecting xfs_buf_unlock to pick it up are converted
to call xfs_buf_delwri_queue directly, too. Also replace the
XFS_BUF_UNDELAYWRITE macro with direct calls to xfs_buf_delwri_dequeue
to make the explicit queuing/dequeuing more obvious.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r-- | fs/xfs/xfs_buf.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 86c0945053c9..309eca75fad4 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
@@ -43,7 +43,6 @@ | |||
43 | 43 | ||
44 | static kmem_zone_t *xfs_buf_zone; | 44 | static kmem_zone_t *xfs_buf_zone; |
45 | STATIC int xfsbufd(void *); | 45 | STATIC int xfsbufd(void *); |
46 | STATIC void xfs_buf_delwri_queue(xfs_buf_t *); | ||
47 | 46 | ||
48 | static struct workqueue_struct *xfslogd_workqueue; | 47 | static struct workqueue_struct *xfslogd_workqueue; |
49 | struct workqueue_struct *xfsdatad_workqueue; | 48 | struct workqueue_struct *xfsdatad_workqueue; |
@@ -937,9 +936,6 @@ void | |||
937 | xfs_buf_unlock( | 936 | xfs_buf_unlock( |
938 | struct xfs_buf *bp) | 937 | struct xfs_buf *bp) |
939 | { | 938 | { |
940 | if ((bp->b_flags & (XBF_DELWRI|_XBF_DELWRI_Q)) == XBF_DELWRI) | ||
941 | xfs_buf_delwri_queue(bp); | ||
942 | |||
943 | XB_CLEAR_OWNER(bp); | 939 | XB_CLEAR_OWNER(bp); |
944 | up(&bp->b_sema); | 940 | up(&bp->b_sema); |
945 | 941 | ||
@@ -1036,17 +1032,6 @@ xfs_bwrite( | |||
1036 | return error; | 1032 | return error; |
1037 | } | 1033 | } |
1038 | 1034 | ||
1039 | void | ||
1040 | xfs_bdwrite( | ||
1041 | void *mp, | ||
1042 | struct xfs_buf *bp) | ||
1043 | { | ||
1044 | trace_xfs_buf_bdwrite(bp, _RET_IP_); | ||
1045 | |||
1046 | xfs_buf_delwri_queue(bp); | ||
1047 | xfs_buf_relse(bp); | ||
1048 | } | ||
1049 | |||
1050 | /* | 1035 | /* |
1051 | * Called when we want to stop a buffer from getting written or read. | 1036 | * Called when we want to stop a buffer from getting written or read. |
1052 | * We attach the EIO error, muck with its flags, and call xfs_buf_ioend | 1037 | * We attach the EIO error, muck with its flags, and call xfs_buf_ioend |
@@ -1069,7 +1054,7 @@ xfs_bioerror( | |||
1069 | * We're calling xfs_buf_ioend, so delete XBF_DONE flag. | 1054 | * We're calling xfs_buf_ioend, so delete XBF_DONE flag. |
1070 | */ | 1055 | */ |
1071 | XFS_BUF_UNREAD(bp); | 1056 | XFS_BUF_UNREAD(bp); |
1072 | XFS_BUF_UNDELAYWRITE(bp); | 1057 | xfs_buf_delwri_dequeue(bp); |
1073 | XFS_BUF_UNDONE(bp); | 1058 | XFS_BUF_UNDONE(bp); |
1074 | XFS_BUF_STALE(bp); | 1059 | XFS_BUF_STALE(bp); |
1075 | 1060 | ||
@@ -1098,7 +1083,7 @@ xfs_bioerror_relse( | |||
1098 | * change that interface. | 1083 | * change that interface. |
1099 | */ | 1084 | */ |
1100 | XFS_BUF_UNREAD(bp); | 1085 | XFS_BUF_UNREAD(bp); |
1101 | XFS_BUF_UNDELAYWRITE(bp); | 1086 | xfs_buf_delwri_dequeue(bp); |
1102 | XFS_BUF_DONE(bp); | 1087 | XFS_BUF_DONE(bp); |
1103 | XFS_BUF_STALE(bp); | 1088 | XFS_BUF_STALE(bp); |
1104 | bp->b_iodone = NULL; | 1089 | bp->b_iodone = NULL; |
@@ -1555,7 +1540,7 @@ error: | |||
1555 | /* | 1540 | /* |
1556 | * Delayed write buffer handling | 1541 | * Delayed write buffer handling |
1557 | */ | 1542 | */ |
1558 | STATIC void | 1543 | void |
1559 | xfs_buf_delwri_queue( | 1544 | xfs_buf_delwri_queue( |
1560 | xfs_buf_t *bp) | 1545 | xfs_buf_t *bp) |
1561 | { | 1546 | { |