diff options
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 97c7452e2620..977c4aec587e 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -281,7 +281,7 @@ xfs_inode_item_format( | |||
281 | xfs_mark_inode_dirty_sync(ip); | 281 | xfs_mark_inode_dirty_sync(ip); |
282 | 282 | ||
283 | vecp->i_addr = (xfs_caddr_t)&ip->i_d; | 283 | vecp->i_addr = (xfs_caddr_t)&ip->i_d; |
284 | vecp->i_len = sizeof(xfs_dinode_core_t); | 284 | vecp->i_len = sizeof(struct xfs_icdinode); |
285 | XLOG_VEC_SET_TYPE(vecp, XLOG_REG_TYPE_ICORE); | 285 | XLOG_VEC_SET_TYPE(vecp, XLOG_REG_TYPE_ICORE); |
286 | vecp++; | 286 | vecp++; |
287 | nvecs++; | 287 | nvecs++; |
@@ -296,9 +296,8 @@ xfs_inode_item_format( | |||
296 | * has a new version number, then we don't bother converting back. | 296 | * has a new version number, then we don't bother converting back. |
297 | */ | 297 | */ |
298 | mp = ip->i_mount; | 298 | mp = ip->i_mount; |
299 | ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1 || | 299 | ASSERT(ip->i_d.di_version == 1 || xfs_sb_version_hasnlink(&mp->m_sb)); |
300 | xfs_sb_version_hasnlink(&mp->m_sb)); | 300 | if (ip->i_d.di_version == 1) { |
301 | if (ip->i_d.di_version == XFS_DINODE_VERSION_1) { | ||
302 | if (!xfs_sb_version_hasnlink(&mp->m_sb)) { | 301 | if (!xfs_sb_version_hasnlink(&mp->m_sb)) { |
303 | /* | 302 | /* |
304 | * Convert it back. | 303 | * Convert it back. |
@@ -311,7 +310,7 @@ xfs_inode_item_format( | |||
311 | * so just make the conversion to the new inode | 310 | * so just make the conversion to the new inode |
312 | * format permanent. | 311 | * format permanent. |
313 | */ | 312 | */ |
314 | ip->i_d.di_version = XFS_DINODE_VERSION_2; | 313 | ip->i_d.di_version = 2; |
315 | ip->i_d.di_onlink = 0; | 314 | ip->i_d.di_onlink = 0; |
316 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); | 315 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); |
317 | } | 316 | } |
@@ -932,6 +931,7 @@ xfs_inode_item_init( | |||
932 | iip->ili_item.li_type = XFS_LI_INODE; | 931 | iip->ili_item.li_type = XFS_LI_INODE; |
933 | iip->ili_item.li_ops = &xfs_inode_item_ops; | 932 | iip->ili_item.li_ops = &xfs_inode_item_ops; |
934 | iip->ili_item.li_mountp = mp; | 933 | iip->ili_item.li_mountp = mp; |
934 | iip->ili_item.li_ailp = mp->m_ail; | ||
935 | iip->ili_inode = ip; | 935 | iip->ili_inode = ip; |
936 | 936 | ||
937 | /* | 937 | /* |
@@ -942,9 +942,9 @@ xfs_inode_item_init( | |||
942 | 942 | ||
943 | iip->ili_format.ilf_type = XFS_LI_INODE; | 943 | iip->ili_format.ilf_type = XFS_LI_INODE; |
944 | iip->ili_format.ilf_ino = ip->i_ino; | 944 | iip->ili_format.ilf_ino = ip->i_ino; |
945 | iip->ili_format.ilf_blkno = ip->i_blkno; | 945 | iip->ili_format.ilf_blkno = ip->i_imap.im_blkno; |
946 | iip->ili_format.ilf_len = ip->i_len; | 946 | iip->ili_format.ilf_len = ip->i_imap.im_len; |
947 | iip->ili_format.ilf_boffset = ip->i_boffset; | 947 | iip->ili_format.ilf_boffset = ip->i_imap.im_boffset; |
948 | } | 948 | } |
949 | 949 | ||
950 | /* | 950 | /* |
@@ -976,9 +976,8 @@ xfs_iflush_done( | |||
976 | xfs_buf_t *bp, | 976 | xfs_buf_t *bp, |
977 | xfs_inode_log_item_t *iip) | 977 | xfs_inode_log_item_t *iip) |
978 | { | 978 | { |
979 | xfs_inode_t *ip; | 979 | xfs_inode_t *ip = iip->ili_inode; |
980 | 980 | struct xfs_ail *ailp = iip->ili_item.li_ailp; | |
981 | ip = iip->ili_inode; | ||
982 | 981 | ||
983 | /* | 982 | /* |
984 | * We only want to pull the item from the AIL if it is | 983 | * We only want to pull the item from the AIL if it is |
@@ -991,15 +990,12 @@ xfs_iflush_done( | |||
991 | */ | 990 | */ |
992 | if (iip->ili_logged && | 991 | if (iip->ili_logged && |
993 | (iip->ili_item.li_lsn == iip->ili_flush_lsn)) { | 992 | (iip->ili_item.li_lsn == iip->ili_flush_lsn)) { |
994 | spin_lock(&ip->i_mount->m_ail_lock); | 993 | spin_lock(&ailp->xa_lock); |
995 | if (iip->ili_item.li_lsn == iip->ili_flush_lsn) { | 994 | if (iip->ili_item.li_lsn == iip->ili_flush_lsn) { |
996 | /* | 995 | /* xfs_trans_ail_delete() drops the AIL lock. */ |
997 | * xfs_trans_delete_ail() drops the AIL lock. | 996 | xfs_trans_ail_delete(ailp, (xfs_log_item_t*)iip); |
998 | */ | ||
999 | xfs_trans_delete_ail(ip->i_mount, | ||
1000 | (xfs_log_item_t*)iip); | ||
1001 | } else { | 997 | } else { |
1002 | spin_unlock(&ip->i_mount->m_ail_lock); | 998 | spin_unlock(&ailp->xa_lock); |
1003 | } | 999 | } |
1004 | } | 1000 | } |
1005 | 1001 | ||
@@ -1031,21 +1027,20 @@ void | |||
1031 | xfs_iflush_abort( | 1027 | xfs_iflush_abort( |
1032 | xfs_inode_t *ip) | 1028 | xfs_inode_t *ip) |
1033 | { | 1029 | { |
1034 | xfs_inode_log_item_t *iip; | 1030 | xfs_inode_log_item_t *iip = ip->i_itemp; |
1035 | xfs_mount_t *mp; | 1031 | xfs_mount_t *mp; |
1036 | 1032 | ||
1037 | iip = ip->i_itemp; | 1033 | iip = ip->i_itemp; |
1038 | mp = ip->i_mount; | 1034 | mp = ip->i_mount; |
1039 | if (iip) { | 1035 | if (iip) { |
1036 | struct xfs_ail *ailp = iip->ili_item.li_ailp; | ||
1040 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { | 1037 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { |
1041 | spin_lock(&mp->m_ail_lock); | 1038 | spin_lock(&ailp->xa_lock); |
1042 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { | 1039 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { |
1043 | /* | 1040 | /* xfs_trans_ail_delete() drops the AIL lock. */ |
1044 | * xfs_trans_delete_ail() drops the AIL lock. | 1041 | xfs_trans_ail_delete(ailp, (xfs_log_item_t *)iip); |
1045 | */ | ||
1046 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)iip); | ||
1047 | } else | 1042 | } else |
1048 | spin_unlock(&mp->m_ail_lock); | 1043 | spin_unlock(&ailp->xa_lock); |
1049 | } | 1044 | } |
1050 | iip->ili_logged = 0; | 1045 | iip->ili_logged = 0; |
1051 | /* | 1046 | /* |