diff options
author | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:28:27 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:28:27 -0500 |
commit | 3d693c6ed7892d066e8fb3311c6b74f7699326f9 (patch) | |
tree | 98cbbe6e0bbdbd775e990bad6a5822904f32aa19 /fs/xfs/xfs_dir2_block.c | |
parent | 3c1f9c158050259cf3965cf900916ec49a288972 (diff) |
[XFS] endianess annotations for XFS_DIR2_DATA_ENTRY_TAG_P
SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25494a
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r-- | fs/xfs/xfs_dir2_block.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index fa372b2b433d..25d3a04f2e46 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -81,7 +81,7 @@ xfs_dir2_block_addname( | |||
81 | xfs_mount_t *mp; /* filesystem mount point */ | 81 | xfs_mount_t *mp; /* filesystem mount point */ |
82 | int needlog; /* need to log header */ | 82 | int needlog; /* need to log header */ |
83 | int needscan; /* need to rescan freespace */ | 83 | int needscan; /* need to rescan freespace */ |
84 | xfs_dir2_data_off_t *tagp; /* pointer to tag value */ | 84 | __be16 *tagp; /* pointer to tag value */ |
85 | xfs_trans_t *tp; /* transaction structure */ | 85 | xfs_trans_t *tp; /* transaction structure */ |
86 | 86 | ||
87 | xfs_dir2_trace_args("block_addname", args); | 87 | xfs_dir2_trace_args("block_addname", args); |
@@ -120,11 +120,11 @@ xfs_dir2_block_addname( | |||
120 | /* | 120 | /* |
121 | * Tag just before the first leaf entry. | 121 | * Tag just before the first leaf entry. |
122 | */ | 122 | */ |
123 | tagp = (xfs_dir2_data_off_t *)blp - 1; | 123 | tagp = (__be16 *)blp - 1; |
124 | /* | 124 | /* |
125 | * Data object just before the first leaf entry. | 125 | * Data object just before the first leaf entry. |
126 | */ | 126 | */ |
127 | enddup = (xfs_dir2_data_unused_t *)((char *)block + INT_GET(*tagp, ARCH_CONVERT)); | 127 | enddup = (xfs_dir2_data_unused_t *)((char *)block + be16_to_cpu(*tagp)); |
128 | /* | 128 | /* |
129 | * If it's not free then can't do this add without cleaning up: | 129 | * If it's not free then can't do this add without cleaning up: |
130 | * the space before the first leaf entry needs to be free so it | 130 | * the space before the first leaf entry needs to be free so it |
@@ -183,11 +183,11 @@ xfs_dir2_block_addname( | |||
183 | /* | 183 | /* |
184 | * Tag just before the first leaf entry. | 184 | * Tag just before the first leaf entry. |
185 | */ | 185 | */ |
186 | tagp = (xfs_dir2_data_off_t *)blp - 1; | 186 | tagp = (__be16 *)blp - 1; |
187 | /* | 187 | /* |
188 | * Data object just before the first leaf entry. | 188 | * Data object just before the first leaf entry. |
189 | */ | 189 | */ |
190 | dup = (xfs_dir2_data_unused_t *)((char *)block + INT_GET(*tagp, ARCH_CONVERT)); | 190 | dup = (xfs_dir2_data_unused_t *)((char *)block + be16_to_cpu(*tagp)); |
191 | /* | 191 | /* |
192 | * If it's not free then the data will go where the | 192 | * If it's not free then the data will go where the |
193 | * leaf data starts now, if it works at all. | 193 | * leaf data starts now, if it works at all. |
@@ -404,7 +404,7 @@ xfs_dir2_block_addname( | |||
404 | dep->namelen = args->namelen; | 404 | dep->namelen = args->namelen; |
405 | memcpy(dep->name, args->name, args->namelen); | 405 | memcpy(dep->name, args->name, args->namelen); |
406 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); | 406 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); |
407 | INT_SET(*tagp, ARCH_CONVERT, (xfs_dir2_data_off_t)((char *)dep - (char *)block)); | 407 | *tagp = cpu_to_be16((char *)dep - (char *)block); |
408 | /* | 408 | /* |
409 | * Clean up the bestfree array and log the header, tail, and entry. | 409 | * Clean up the bestfree array and log the header, tail, and entry. |
410 | */ | 410 | */ |
@@ -896,7 +896,7 @@ xfs_dir2_leaf_to_block( | |||
896 | int needscan; /* need to scan for bestfree */ | 896 | int needscan; /* need to scan for bestfree */ |
897 | xfs_dir2_sf_hdr_t sfh; /* shortform header */ | 897 | xfs_dir2_sf_hdr_t sfh; /* shortform header */ |
898 | int size; /* bytes used */ | 898 | int size; /* bytes used */ |
899 | xfs_dir2_data_off_t *tagp; /* end of entry (tag) */ | 899 | __be16 *tagp; /* end of entry (tag) */ |
900 | int to; /* block/leaf to index */ | 900 | int to; /* block/leaf to index */ |
901 | xfs_trans_t *tp; /* transaction pointer */ | 901 | xfs_trans_t *tp; /* transaction pointer */ |
902 | 902 | ||
@@ -944,8 +944,8 @@ xfs_dir2_leaf_to_block( | |||
944 | /* | 944 | /* |
945 | * Look at the last data entry. | 945 | * Look at the last data entry. |
946 | */ | 946 | */ |
947 | tagp = (xfs_dir2_data_off_t *)((char *)block + mp->m_dirblksize) - 1; | 947 | tagp = (__be16 *)((char *)block + mp->m_dirblksize) - 1; |
948 | dup = (xfs_dir2_data_unused_t *)((char *)block + INT_GET(*tagp, ARCH_CONVERT)); | 948 | dup = (xfs_dir2_data_unused_t *)((char *)block + be16_to_cpu(*tagp)); |
949 | /* | 949 | /* |
950 | * If it's not free or is too short we can't do it. | 950 | * If it's not free or is too short we can't do it. |
951 | */ | 951 | */ |
@@ -1044,7 +1044,7 @@ xfs_dir2_sf_to_block( | |||
1044 | int offset; /* target block offset */ | 1044 | int offset; /* target block offset */ |
1045 | xfs_dir2_sf_entry_t *sfep; /* sf entry pointer */ | 1045 | xfs_dir2_sf_entry_t *sfep; /* sf entry pointer */ |
1046 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 1046 | xfs_dir2_sf_t *sfp; /* shortform structure */ |
1047 | xfs_dir2_data_off_t *tagp; /* end of data entry */ | 1047 | __be16 *tagp; /* end of data entry */ |
1048 | xfs_trans_t *tp; /* transaction pointer */ | 1048 | xfs_trans_t *tp; /* transaction pointer */ |
1049 | 1049 | ||
1050 | xfs_dir2_trace_args("sf_to_block", args); | 1050 | xfs_dir2_trace_args("sf_to_block", args); |
@@ -1134,7 +1134,7 @@ xfs_dir2_sf_to_block( | |||
1134 | dep->namelen = 1; | 1134 | dep->namelen = 1; |
1135 | dep->name[0] = '.'; | 1135 | dep->name[0] = '.'; |
1136 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); | 1136 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); |
1137 | INT_SET(*tagp, ARCH_CONVERT, (xfs_dir2_data_off_t)((char *)dep - (char *)block)); | 1137 | *tagp = cpu_to_be16((char *)dep - (char *)block); |
1138 | xfs_dir2_data_log_entry(tp, bp, dep); | 1138 | xfs_dir2_data_log_entry(tp, bp, dep); |
1139 | blp[0].hashval = cpu_to_be32(xfs_dir_hash_dot); | 1139 | blp[0].hashval = cpu_to_be32(xfs_dir_hash_dot); |
1140 | blp[0].address = cpu_to_be32(XFS_DIR2_BYTE_TO_DATAPTR(mp, | 1140 | blp[0].address = cpu_to_be32(XFS_DIR2_BYTE_TO_DATAPTR(mp, |
@@ -1148,7 +1148,7 @@ xfs_dir2_sf_to_block( | |||
1148 | dep->namelen = 2; | 1148 | dep->namelen = 2; |
1149 | dep->name[0] = dep->name[1] = '.'; | 1149 | dep->name[0] = dep->name[1] = '.'; |
1150 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); | 1150 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); |
1151 | INT_SET(*tagp, ARCH_CONVERT, (xfs_dir2_data_off_t)((char *)dep - (char *)block)); | 1151 | *tagp = cpu_to_be16((char *)dep - (char *)block); |
1152 | xfs_dir2_data_log_entry(tp, bp, dep); | 1152 | xfs_dir2_data_log_entry(tp, bp, dep); |
1153 | blp[1].hashval = cpu_to_be32(xfs_dir_hash_dotdot); | 1153 | blp[1].hashval = cpu_to_be32(xfs_dir_hash_dotdot); |
1154 | blp[1].address = cpu_to_be32(XFS_DIR2_BYTE_TO_DATAPTR(mp, | 1154 | blp[1].address = cpu_to_be32(XFS_DIR2_BYTE_TO_DATAPTR(mp, |
@@ -1198,7 +1198,7 @@ xfs_dir2_sf_to_block( | |||
1198 | dep->namelen = sfep->namelen; | 1198 | dep->namelen = sfep->namelen; |
1199 | memcpy(dep->name, sfep->name, dep->namelen); | 1199 | memcpy(dep->name, sfep->name, dep->namelen); |
1200 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); | 1200 | tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); |
1201 | INT_SET(*tagp, ARCH_CONVERT, (xfs_dir2_data_off_t)((char *)dep - (char *)block)); | 1201 | *tagp = cpu_to_be16((char *)dep - (char *)block); |
1202 | xfs_dir2_data_log_entry(tp, bp, dep); | 1202 | xfs_dir2_data_log_entry(tp, bp, dep); |
1203 | blp[2 + i].hashval = cpu_to_be32(xfs_da_hashname( | 1203 | blp[2 + i].hashval = cpu_to_be32(xfs_da_hashname( |
1204 | (char *)sfep->name, sfep->namelen)); | 1204 | (char *)sfep->name, sfep->namelen)); |