diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-08-18 05:29:11 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-10 06:35:38 -0400 |
commit | 80f6c29d8a758650d5c9eac05074b4b3e8c266df (patch) | |
tree | a08a3c49536e382a8f3e473c98d08613a0ac82fa | |
parent | 2cf6d26a354ab6362e301b5a323832b02867df47 (diff) |
xfs: replace barriers with explicit flush / FUA usage
Switch to the WRITE_FLUSH_FUA flag for log writes and remove the EOPNOTSUPP
detection for barriers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 16 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 11 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_trace.h | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 13 |
4 files changed, 3 insertions, 38 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index ea79072f5210..b93ea3342281 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -929,19 +929,7 @@ xfs_buf_iodone_work( | |||
929 | xfs_buf_t *bp = | 929 | xfs_buf_t *bp = |
930 | container_of(work, xfs_buf_t, b_iodone_work); | 930 | container_of(work, xfs_buf_t, b_iodone_work); |
931 | 931 | ||
932 | /* | 932 | if (bp->b_iodone) |
933 | * We can get an EOPNOTSUPP to ordered writes. Here we clear the | ||
934 | * ordered flag and reissue them. Because we can't tell the higher | ||
935 | * layers directly that they should not issue ordered I/O anymore, they | ||
936 | * need to check if the _XFS_BARRIER_FAILED flag was set during I/O completion. | ||
937 | */ | ||
938 | if ((bp->b_error == EOPNOTSUPP) && | ||
939 | (bp->b_flags & (XBF_ORDERED|XBF_ASYNC)) == (XBF_ORDERED|XBF_ASYNC)) { | ||
940 | trace_xfs_buf_ordered_retry(bp, _RET_IP_); | ||
941 | bp->b_flags &= ~XBF_ORDERED; | ||
942 | bp->b_flags |= _XFS_BARRIER_FAILED; | ||
943 | xfs_buf_iorequest(bp); | ||
944 | } else if (bp->b_iodone) | ||
945 | (*(bp->b_iodone))(bp); | 933 | (*(bp->b_iodone))(bp); |
946 | else if (bp->b_flags & XBF_ASYNC) | 934 | else if (bp->b_flags & XBF_ASYNC) |
947 | xfs_buf_relse(bp); | 935 | xfs_buf_relse(bp); |
@@ -1200,7 +1188,7 @@ _xfs_buf_ioapply( | |||
1200 | 1188 | ||
1201 | if (bp->b_flags & XBF_ORDERED) { | 1189 | if (bp->b_flags & XBF_ORDERED) { |
1202 | ASSERT(!(bp->b_flags & XBF_READ)); | 1190 | ASSERT(!(bp->b_flags & XBF_READ)); |
1203 | rw = WRITE_BARRIER; | 1191 | rw = WRITE_FLUSH_FUA; |
1204 | } else if (bp->b_flags & XBF_LOG_BUFFER) { | 1192 | } else if (bp->b_flags & XBF_LOG_BUFFER) { |
1205 | ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); | 1193 | ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); |
1206 | bp->b_flags &= ~_XBF_RUN_QUEUES; | 1194 | bp->b_flags &= ~_XBF_RUN_QUEUES; |
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index d072e5ff923b..d533d64e2c3e 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
@@ -86,14 +86,6 @@ typedef enum { | |||
86 | */ | 86 | */ |
87 | #define _XBF_PAGE_LOCKED (1 << 22) | 87 | #define _XBF_PAGE_LOCKED (1 << 22) |
88 | 88 | ||
89 | /* | ||
90 | * If we try a barrier write, but it fails we have to communicate | ||
91 | * this to the upper layers. Unfortunately b_error gets overwritten | ||
92 | * when the buffer is re-issued so we have to add another flag to | ||
93 | * keep this information. | ||
94 | */ | ||
95 | #define _XFS_BARRIER_FAILED (1 << 23) | ||
96 | |||
97 | typedef unsigned int xfs_buf_flags_t; | 89 | typedef unsigned int xfs_buf_flags_t; |
98 | 90 | ||
99 | #define XFS_BUF_FLAGS \ | 91 | #define XFS_BUF_FLAGS \ |
@@ -114,8 +106,7 @@ typedef unsigned int xfs_buf_flags_t; | |||
114 | { _XBF_PAGES, "PAGES" }, \ | 106 | { _XBF_PAGES, "PAGES" }, \ |
115 | { _XBF_RUN_QUEUES, "RUN_QUEUES" }, \ | 107 | { _XBF_RUN_QUEUES, "RUN_QUEUES" }, \ |
116 | { _XBF_DELWRI_Q, "DELWRI_Q" }, \ | 108 | { _XBF_DELWRI_Q, "DELWRI_Q" }, \ |
117 | { _XBF_PAGE_LOCKED, "PAGE_LOCKED" }, \ | 109 | { _XBF_PAGE_LOCKED, "PAGE_LOCKED" } |
118 | { _XFS_BARRIER_FAILED, "BARRIER_FAILED" } | ||
119 | 110 | ||
120 | 111 | ||
121 | typedef enum { | 112 | typedef enum { |
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h index be5dffd282a1..8fe311a456e2 100644 --- a/fs/xfs/linux-2.6/xfs_trace.h +++ b/fs/xfs/linux-2.6/xfs_trace.h | |||
@@ -325,7 +325,6 @@ DEFINE_BUF_EVENT(xfs_buf_lock); | |||
325 | DEFINE_BUF_EVENT(xfs_buf_lock_done); | 325 | DEFINE_BUF_EVENT(xfs_buf_lock_done); |
326 | DEFINE_BUF_EVENT(xfs_buf_cond_lock); | 326 | DEFINE_BUF_EVENT(xfs_buf_cond_lock); |
327 | DEFINE_BUF_EVENT(xfs_buf_unlock); | 327 | DEFINE_BUF_EVENT(xfs_buf_unlock); |
328 | DEFINE_BUF_EVENT(xfs_buf_ordered_retry); | ||
329 | DEFINE_BUF_EVENT(xfs_buf_iowait); | 328 | DEFINE_BUF_EVENT(xfs_buf_iowait); |
330 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); | 329 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); |
331 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); | 330 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 925d572bf0f4..430a8fc02c1f 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -917,19 +917,6 @@ xlog_iodone(xfs_buf_t *bp) | |||
917 | l = iclog->ic_log; | 917 | l = iclog->ic_log; |
918 | 918 | ||
919 | /* | 919 | /* |
920 | * If the _XFS_BARRIER_FAILED flag was set by a lower | ||
921 | * layer, it means the underlying device no longer supports | ||
922 | * barrier I/O. Warn loudly and turn off barriers. | ||
923 | */ | ||
924 | if (bp->b_flags & _XFS_BARRIER_FAILED) { | ||
925 | bp->b_flags &= ~_XFS_BARRIER_FAILED; | ||
926 | l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
927 | xfs_fs_cmn_err(CE_WARN, l->l_mp, | ||
928 | "xlog_iodone: Barriers are no longer supported" | ||
929 | " by device. Disabling barriers\n"); | ||
930 | } | ||
931 | |||
932 | /* | ||
933 | * Race to shutdown the filesystem if we see an error. | 920 | * Race to shutdown the filesystem if we see an error. |
934 | */ | 921 | */ |
935 | if (XFS_TEST_ERROR((XFS_BUF_GETERROR(bp)), l->l_mp, | 922 | if (XFS_TEST_ERROR((XFS_BUF_GETERROR(bp)), l->l_mp, |