aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 281cbd45b3d3..df0d4572d70a 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1864,8 +1864,8 @@ xfs_iunlink(
1864 */ 1864 */
1865 agi = XFS_BUF_TO_AGI(agibp); 1865 agi = XFS_BUF_TO_AGI(agibp);
1866 agi_ok = 1866 agi_ok =
1867 INT_GET(agi->agi_magicnum, ARCH_CONVERT) == XFS_AGI_MAGIC && 1867 be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC &&
1868 XFS_AGI_GOOD_VERSION(INT_GET(agi->agi_versionnum, ARCH_CONVERT)); 1868 XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum));
1869 if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK, 1869 if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK,
1870 XFS_RANDOM_IUNLINK))) { 1870 XFS_RANDOM_IUNLINK))) {
1871 XFS_CORRUPTION_ERROR("xfs_iunlink", XFS_ERRLEVEL_LOW, mp, agi); 1871 XFS_CORRUPTION_ERROR("xfs_iunlink", XFS_ERRLEVEL_LOW, mp, agi);
@@ -1880,9 +1880,9 @@ xfs_iunlink(
1880 ASSERT(agino != 0); 1880 ASSERT(agino != 0);
1881 bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS; 1881 bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS;
1882 ASSERT(agi->agi_unlinked[bucket_index]); 1882 ASSERT(agi->agi_unlinked[bucket_index]);
1883 ASSERT(INT_GET(agi->agi_unlinked[bucket_index], ARCH_CONVERT) != agino); 1883 ASSERT(be32_to_cpu(agi->agi_unlinked[bucket_index]) != agino);
1884 1884
1885 if (INT_GET(agi->agi_unlinked[bucket_index], ARCH_CONVERT) != NULLAGINO) { 1885 if (be32_to_cpu(agi->agi_unlinked[bucket_index]) != NULLAGINO) {
1886 /* 1886 /*
1887 * There is already another inode in the bucket we need 1887 * There is already another inode in the bucket we need
1888 * to add ourselves to. Add us at the front of the list. 1888 * to add ourselves to. Add us at the front of the list.
@@ -1909,7 +1909,7 @@ xfs_iunlink(
1909 * Point the bucket head pointer at the inode being inserted. 1909 * Point the bucket head pointer at the inode being inserted.
1910 */ 1910 */
1911 ASSERT(agino != 0); 1911 ASSERT(agino != 0);
1912 INT_SET(agi->agi_unlinked[bucket_index], ARCH_CONVERT, agino); 1912 agi->agi_unlinked[bucket_index] = cpu_to_be32(agino);
1913 offset = offsetof(xfs_agi_t, agi_unlinked) + 1913 offset = offsetof(xfs_agi_t, agi_unlinked) +
1914 (sizeof(xfs_agino_t) * bucket_index); 1914 (sizeof(xfs_agino_t) * bucket_index);
1915 xfs_trans_log_buf(tp, agibp, offset, 1915 xfs_trans_log_buf(tp, agibp, offset,
@@ -1967,8 +1967,8 @@ xfs_iunlink_remove(
1967 */ 1967 */
1968 agi = XFS_BUF_TO_AGI(agibp); 1968 agi = XFS_BUF_TO_AGI(agibp);
1969 agi_ok = 1969 agi_ok =
1970 INT_GET(agi->agi_magicnum, ARCH_CONVERT) == XFS_AGI_MAGIC && 1970 be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC &&
1971 XFS_AGI_GOOD_VERSION(INT_GET(agi->agi_versionnum, ARCH_CONVERT)); 1971 XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum));
1972 if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK_REMOVE, 1972 if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK_REMOVE,
1973 XFS_RANDOM_IUNLINK_REMOVE))) { 1973 XFS_RANDOM_IUNLINK_REMOVE))) {
1974 XFS_CORRUPTION_ERROR("xfs_iunlink_remove", XFS_ERRLEVEL_LOW, 1974 XFS_CORRUPTION_ERROR("xfs_iunlink_remove", XFS_ERRLEVEL_LOW,
@@ -1986,10 +1986,10 @@ xfs_iunlink_remove(
1986 agino = XFS_INO_TO_AGINO(mp, ip->i_ino); 1986 agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
1987 ASSERT(agino != 0); 1987 ASSERT(agino != 0);
1988 bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS; 1988 bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS;
1989 ASSERT(INT_GET(agi->agi_unlinked[bucket_index], ARCH_CONVERT) != NULLAGINO); 1989 ASSERT(be32_to_cpu(agi->agi_unlinked[bucket_index]) != NULLAGINO);
1990 ASSERT(agi->agi_unlinked[bucket_index]); 1990 ASSERT(agi->agi_unlinked[bucket_index]);
1991 1991
1992 if (INT_GET(agi->agi_unlinked[bucket_index], ARCH_CONVERT) == agino) { 1992 if (be32_to_cpu(agi->agi_unlinked[bucket_index]) == agino) {
1993 /* 1993 /*
1994 * We're at the head of the list. Get the inode's 1994 * We're at the head of the list. Get the inode's
1995 * on-disk buffer to see if there is anyone after us 1995 * on-disk buffer to see if there is anyone after us
@@ -2023,7 +2023,7 @@ xfs_iunlink_remove(
2023 */ 2023 */
2024 ASSERT(next_agino != 0); 2024 ASSERT(next_agino != 0);
2025 ASSERT(next_agino != agino); 2025 ASSERT(next_agino != agino);
2026 INT_SET(agi->agi_unlinked[bucket_index], ARCH_CONVERT, next_agino); 2026 agi->agi_unlinked[bucket_index] = cpu_to_be32(next_agino);
2027 offset = offsetof(xfs_agi_t, agi_unlinked) + 2027 offset = offsetof(xfs_agi_t, agi_unlinked) +
2028 (sizeof(xfs_agino_t) * bucket_index); 2028 (sizeof(xfs_agino_t) * bucket_index);
2029 xfs_trans_log_buf(tp, agibp, offset, 2029 xfs_trans_log_buf(tp, agibp, offset,
@@ -2032,7 +2032,7 @@ xfs_iunlink_remove(
2032 /* 2032 /*
2033 * We need to search the list for the inode being freed. 2033 * We need to search the list for the inode being freed.
2034 */ 2034 */
2035 next_agino = INT_GET(agi->agi_unlinked[bucket_index], ARCH_CONVERT); 2035 next_agino = be32_to_cpu(agi->agi_unlinked[bucket_index]);
2036 last_ibp = NULL; 2036 last_ibp = NULL;
2037 while (next_agino != agino) { 2037 while (next_agino != agino) {
2038 /* 2038 /*