diff options
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 9 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_quotaops.c | 1 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_trace.h | 83 | ||||
| -rw-r--r-- | fs/xfs/xfs_ag.h | 24 | ||||
| -rw-r--r-- | fs/xfs/xfs_alloc.c | 357 | ||||
| -rw-r--r-- | fs/xfs/xfs_alloc.h | 7 | ||||
| -rw-r--r-- | fs/xfs/xfs_alloc_btree.c | 2 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans.c | 41 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans.h | 35 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans_item.c | 109 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans_priv.h | 4 |
11 files changed, 350 insertions, 322 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index f01de3c55c43..649ade8ef598 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | #include "xfs_sb.h" | 38 | #include "xfs_sb.h" |
| 39 | #include "xfs_inum.h" | 39 | #include "xfs_inum.h" |
| 40 | #include "xfs_log.h" | ||
| 40 | #include "xfs_ag.h" | 41 | #include "xfs_ag.h" |
| 41 | #include "xfs_dmapi.h" | 42 | #include "xfs_dmapi.h" |
| 42 | #include "xfs_mount.h" | 43 | #include "xfs_mount.h" |
| @@ -850,6 +851,12 @@ xfs_buf_lock_value( | |||
| 850 | * Note that this in no way locks the underlying pages, so it is only | 851 | * Note that this in no way locks the underlying pages, so it is only |
| 851 | * useful for synchronizing concurrent use of buffer objects, not for | 852 | * useful for synchronizing concurrent use of buffer objects, not for |
| 852 | * synchronizing independent access to the underlying pages. | 853 | * synchronizing independent access to the underlying pages. |
| 854 | * | ||
| 855 | * If we come across a stale, pinned, locked buffer, we know that we | ||
| 856 | * are being asked to lock a buffer that has been reallocated. Because | ||
| 857 | * it is pinned, we know that the log has not been pushed to disk and | ||
| 858 | * hence it will still be locked. Rather than sleeping until someone | ||
| 859 | * else pushes the log, push it ourselves before trying to get the lock. | ||
| 853 | */ | 860 | */ |
| 854 | void | 861 | void |
| 855 | xfs_buf_lock( | 862 | xfs_buf_lock( |
| @@ -857,6 +864,8 @@ xfs_buf_lock( | |||
| 857 | { | 864 | { |
| 858 | trace_xfs_buf_lock(bp, _RET_IP_); | 865 | trace_xfs_buf_lock(bp, _RET_IP_); |
| 859 | 866 | ||
| 867 | if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE)) | ||
| 868 | xfs_log_force(bp->b_mount, 0); | ||
| 860 | if (atomic_read(&bp->b_io_remaining)) | 869 | if (atomic_read(&bp->b_io_remaining)) |
| 861 | blk_run_address_space(bp->b_target->bt_mapping); | 870 | blk_run_address_space(bp->b_target->bt_mapping); |
| 862 | down(&bp->b_sema); | 871 | down(&bp->b_sema); |
diff --git a/fs/xfs/linux-2.6/xfs_quotaops.c b/fs/xfs/linux-2.6/xfs_quotaops.c index 1947514ce1ad..2e73688dae9c 100644 --- a/fs/xfs/linux-2.6/xfs_quotaops.c +++ b/fs/xfs/linux-2.6/xfs_quotaops.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include "xfs_dmapi.h" | 19 | #include "xfs_dmapi.h" |
| 20 | #include "xfs_sb.h" | 20 | #include "xfs_sb.h" |
| 21 | #include "xfs_inum.h" | 21 | #include "xfs_inum.h" |
| 22 | #include "xfs_log.h" | ||
| 22 | #include "xfs_ag.h" | 23 | #include "xfs_ag.h" |
| 23 | #include "xfs_mount.h" | 24 | #include "xfs_mount.h" |
| 24 | #include "xfs_quota.h" | 25 | #include "xfs_quota.h" |
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h index 8a319cfd2901..ff6bc797baf2 100644 --- a/fs/xfs/linux-2.6/xfs_trace.h +++ b/fs/xfs/linux-2.6/xfs_trace.h | |||
| @@ -1059,83 +1059,112 @@ TRACE_EVENT(xfs_bunmap, | |||
| 1059 | 1059 | ||
| 1060 | ); | 1060 | ); |
| 1061 | 1061 | ||
| 1062 | #define XFS_BUSY_SYNC \ | ||
| 1063 | { 0, "async" }, \ | ||
| 1064 | { 1, "sync" } | ||
| 1065 | |||
| 1062 | TRACE_EVENT(xfs_alloc_busy, | 1066 | TRACE_EVENT(xfs_alloc_busy, |
| 1063 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, | 1067 | TP_PROTO(struct xfs_trans *trans, xfs_agnumber_t agno, |
| 1064 | xfs_extlen_t len, int slot), | 1068 | xfs_agblock_t agbno, xfs_extlen_t len, int sync), |
| 1065 | TP_ARGS(mp, agno, agbno, len, slot), | 1069 | TP_ARGS(trans, agno, agbno, len, sync), |
| 1066 | TP_STRUCT__entry( | 1070 | TP_STRUCT__entry( |
| 1067 | __field(dev_t, dev) | 1071 | __field(dev_t, dev) |
| 1072 | __field(struct xfs_trans *, tp) | ||
| 1073 | __field(int, tid) | ||
| 1068 | __field(xfs_agnumber_t, agno) | 1074 | __field(xfs_agnumber_t, agno) |
| 1069 | __field(xfs_agblock_t, agbno) | 1075 | __field(xfs_agblock_t, agbno) |
| 1070 | __field(xfs_extlen_t, len) | 1076 | __field(xfs_extlen_t, len) |
| 1071 | __field(int, slot) | 1077 | __field(int, sync) |
| 1072 | ), | 1078 | ), |
| 1073 | TP_fast_assign( | 1079 | TP_fast_assign( |
| 1074 | __entry->dev = mp->m_super->s_dev; | 1080 | __entry->dev = trans->t_mountp->m_super->s_dev; |
| 1081 | __entry->tp = trans; | ||
| 1082 | __entry->tid = trans->t_ticket->t_tid; | ||
| 1075 | __entry->agno = agno; | 1083 | __entry->agno = agno; |
| 1076 | __entry->agbno = agbno; | 1084 | __entry->agbno = agbno; |
| 1077 | __entry->len = len; | 1085 | __entry->len = len; |
| 1078 | __entry->slot = slot; | 1086 | __entry->sync = sync; |
| 1079 | ), | 1087 | ), |
| 1080 | TP_printk("dev %d:%d agno %u agbno %u len %u slot %d", | 1088 | TP_printk("dev %d:%d trans 0x%p tid 0x%x agno %u agbno %u len %u %s", |
| 1081 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1089 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1090 | __entry->tp, | ||
| 1091 | __entry->tid, | ||
| 1082 | __entry->agno, | 1092 | __entry->agno, |
| 1083 | __entry->agbno, | 1093 | __entry->agbno, |
| 1084 | __entry->len, | 1094 | __entry->len, |
| 1085 | __entry->slot) | 1095 | __print_symbolic(__entry->sync, XFS_BUSY_SYNC)) |
| 1086 | 1096 | ||
| 1087 | ); | 1097 | ); |
| 1088 | 1098 | ||
| 1089 | #define XFS_BUSY_STATES \ | ||
| 1090 | { 0, "found" }, \ | ||
| 1091 | { 1, "missing" } | ||
| 1092 | |||
| 1093 | TRACE_EVENT(xfs_alloc_unbusy, | 1099 | TRACE_EVENT(xfs_alloc_unbusy, |
| 1094 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | 1100 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 1095 | int slot, int found), | 1101 | xfs_agblock_t agbno, xfs_extlen_t len), |
| 1096 | TP_ARGS(mp, agno, slot, found), | 1102 | TP_ARGS(mp, agno, agbno, len), |
| 1097 | TP_STRUCT__entry( | 1103 | TP_STRUCT__entry( |
| 1098 | __field(dev_t, dev) | 1104 | __field(dev_t, dev) |
| 1099 | __field(xfs_agnumber_t, agno) | 1105 | __field(xfs_agnumber_t, agno) |
| 1100 | __field(int, slot) | 1106 | __field(xfs_agblock_t, agbno) |
| 1101 | __field(int, found) | 1107 | __field(xfs_extlen_t, len) |
| 1102 | ), | 1108 | ), |
| 1103 | TP_fast_assign( | 1109 | TP_fast_assign( |
| 1104 | __entry->dev = mp->m_super->s_dev; | 1110 | __entry->dev = mp->m_super->s_dev; |
| 1105 | __entry->agno = agno; | 1111 | __entry->agno = agno; |
| 1106 | __entry->slot = slot; | 1112 | __entry->agbno = agbno; |
| 1107 | __entry->found = found; | 1113 | __entry->len = len; |
| 1108 | ), | 1114 | ), |
| 1109 | TP_printk("dev %d:%d agno %u slot %d %s", | 1115 | TP_printk("dev %d:%d agno %u agbno %u len %u", |
| 1110 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1116 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1111 | __entry->agno, | 1117 | __entry->agno, |
| 1112 | __entry->slot, | 1118 | __entry->agbno, |
| 1113 | __print_symbolic(__entry->found, XFS_BUSY_STATES)) | 1119 | __entry->len) |
| 1114 | ); | 1120 | ); |
| 1115 | 1121 | ||
| 1122 | #define XFS_BUSY_STATES \ | ||
| 1123 | { 0, "missing" }, \ | ||
| 1124 | { 1, "found" } | ||
| 1125 | |||
| 1116 | TRACE_EVENT(xfs_alloc_busysearch, | 1126 | TRACE_EVENT(xfs_alloc_busysearch, |
| 1117 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, | 1127 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 1118 | xfs_extlen_t len, xfs_lsn_t lsn), | 1128 | xfs_agblock_t agbno, xfs_extlen_t len, int found), |
| 1119 | TP_ARGS(mp, agno, agbno, len, lsn), | 1129 | TP_ARGS(mp, agno, agbno, len, found), |
| 1120 | TP_STRUCT__entry( | 1130 | TP_STRUCT__entry( |
| 1121 | __field(dev_t, dev) | 1131 | __field(dev_t, dev) |
| 1122 | __field(xfs_agnumber_t, agno) | 1132 | __field(xfs_agnumber_t, agno) |
| 1123 | __field(xfs_agblock_t, agbno) | 1133 | __field(xfs_agblock_t, agbno) |
| 1124 | __field(xfs_extlen_t, len) | 1134 | __field(xfs_extlen_t, len) |
| 1125 | __field(xfs_lsn_t, lsn) | 1135 | __field(int, found) |
| 1126 | ), | 1136 | ), |
| 1127 | |||
