aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode_item.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r--fs/xfs/xfs_inode_item.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 565d470a6b4a..e365b137ee4f 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -615,7 +615,7 @@ xfs_inode_item_trylock(
615 return XFS_ITEM_PUSHBUF; 615 return XFS_ITEM_PUSHBUF;
616 } else { 616 } else {
617 /* 617 /*
618 * We hold the AIL_LOCK, so we must specify the 618 * We hold the AIL lock, so we must specify the
619 * NONOTIFY flag so that we won't double trip. 619 * NONOTIFY flag so that we won't double trip.
620 */ 620 */
621 xfs_iunlock(ip, XFS_ILOCK_SHARED|XFS_IUNLOCK_NONOTIFY); 621 xfs_iunlock(ip, XFS_ILOCK_SHARED|XFS_IUNLOCK_NONOTIFY);
@@ -749,7 +749,7 @@ xfs_inode_item_committed(
749 * marked delayed write. If that's the case, we'll initiate a bawrite on that 749 * marked delayed write. If that's the case, we'll initiate a bawrite on that
750 * buffer to expedite the process. 750 * buffer to expedite the process.
751 * 751 *
752 * We aren't holding the AIL_LOCK (or the flush lock) when this gets called, 752 * We aren't holding the AIL lock (or the flush lock) when this gets called,
753 * so it is inherently race-y. 753 * so it is inherently race-y.
754 */ 754 */
755STATIC void 755STATIC void
@@ -792,7 +792,7 @@ xfs_inode_item_pushbuf(
792 if (XFS_BUF_ISDELAYWRITE(bp)) { 792 if (XFS_BUF_ISDELAYWRITE(bp)) {
793 /* 793 /*
794 * We were racing with iflush because we don't hold 794 * We were racing with iflush because we don't hold
795 * the AIL_LOCK or the flush lock. However, at this point, 795 * the AIL lock or the flush lock. However, at this point,
796 * we have the buffer, and we know that it's dirty. 796 * we have the buffer, and we know that it's dirty.
797 * So, it's possible that iflush raced with us, and 797 * So, it's possible that iflush raced with us, and
798 * this item is already taken off the AIL. 798 * this item is already taken off the AIL.
@@ -968,7 +968,6 @@ xfs_iflush_done(
968 xfs_inode_log_item_t *iip) 968 xfs_inode_log_item_t *iip)
969{ 969{
970 xfs_inode_t *ip; 970 xfs_inode_t *ip;
971 SPLDECL(s);
972 971
973 ip = iip->ili_inode; 972 ip = iip->ili_inode;
974 973
@@ -983,15 +982,15 @@ xfs_iflush_done(
983 */ 982 */
984 if (iip->ili_logged && 983 if (iip->ili_logged &&
985 (iip->ili_item.li_lsn == iip->ili_flush_lsn)) { 984 (iip->ili_item.li_lsn == iip->ili_flush_lsn)) {
986 AIL_LOCK(ip->i_mount, s); 985 spin_lock(&ip->i_mount->m_ail_lock);
987 if (iip->ili_item.li_lsn == iip->ili_flush_lsn) { 986 if (iip->ili_item.li_lsn == iip->ili_flush_lsn) {
988 /* 987 /*
989 * xfs_trans_delete_ail() drops the AIL lock. 988 * xfs_trans_delete_ail() drops the AIL lock.
990 */ 989 */
991 xfs_trans_delete_ail(ip->i_mount, 990 xfs_trans_delete_ail(ip->i_mount,
992 (xfs_log_item_t*)iip, s); 991 (xfs_log_item_t*)iip);
993 } else { 992 } else {
994 AIL_UNLOCK(ip->i_mount, s); 993 spin_unlock(&ip->i_mount->m_ail_lock);
995 } 994 }
996 } 995 }
997 996
@@ -1025,21 +1024,19 @@ xfs_iflush_abort(
1025{ 1024{
1026 xfs_inode_log_item_t *iip; 1025 xfs_inode_log_item_t *iip;
1027 xfs_mount_t *mp; 1026 xfs_mount_t *mp;
1028 SPLDECL(s);
1029 1027
1030 iip = ip->i_itemp; 1028 iip = ip->i_itemp;
1031 mp = ip->i_mount; 1029 mp = ip->i_mount;
1032 if (iip) { 1030 if (iip) {
1033 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { 1031 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
1034 AIL_LOCK(mp, s); 1032 spin_lock(&mp->m_ail_lock);
1035 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { 1033 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
1036 /* 1034 /*
1037 * xfs_trans_delete_ail() drops the AIL lock. 1035 * xfs_trans_delete_ail() drops the AIL lock.
1038 */ 1036 */
1039 xfs_trans_delete_ail(mp, (xfs_log_item_t *)iip, 1037 xfs_trans_delete_ail(mp, (xfs_log_item_t *)iip);
1040 s);
1041 } else 1038 } else
1042 AIL_UNLOCK(mp, s); 1039 spin_unlock(&mp->m_ail_lock);
1043 } 1040 }
1044 iip->ili_logged = 0; 1041 iip->ili_logged = 0;
1045 /* 1042 /*