aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_block.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-07-08 08:35:38 -0400
committerChristoph Hellwig <hch@lst.de>2011-07-08 08:35:38 -0400
commitc2066e2662070e794f57a96a129c42575e77cfcb (patch)
treec1261009d7482af80db1b554a96b5a62f35b4877 /fs/xfs/xfs_dir2_block.c
parenta64b04179735de6bfd9f00c130a68ed7f20d18ef (diff)
xfs: avoid usage of struct xfs_dir2_data
In most places we can simply pass around and use the struct xfs_dir2_data_hdr, which is the first and most important member of struct xfs_dir2_data instead of the full structure. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r--fs/xfs/xfs_dir2_block.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 9adaf803957a..c9fdabe5e1ad 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -282,7 +282,7 @@ xfs_dir2_block_addname(
282 * This needs to happen before the next call to use_free. 282 * This needs to happen before the next call to use_free.
283 */ 283 */
284 if (needscan) { 284 if (needscan) {
285 xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog); 285 xfs_dir2_data_freescan(mp, hdr, &needlog);
286 needscan = 0; 286 needscan = 0;
287 } 287 }
288 } 288 }
@@ -331,8 +331,7 @@ xfs_dir2_block_addname(
331 * This needs to happen before the next call to use_free. 331 * This needs to happen before the next call to use_free.
332 */ 332 */
333 if (needscan) { 333 if (needscan) {
334 xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, 334 xfs_dir2_data_freescan(mp, hdr, &needlog);
335 &needlog);
336 needscan = 0; 335 needscan = 0;
337 } 336 }
338 /* 337 /*
@@ -417,7 +416,7 @@ xfs_dir2_block_addname(
417 * Clean up the bestfree array and log the header, tail, and entry. 416 * Clean up the bestfree array and log the header, tail, and entry.
418 */ 417 */
419 if (needscan) 418 if (needscan)
420 xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog); 419 xfs_dir2_data_freescan(mp, hdr, &needlog);
421 if (needlog) 420 if (needlog)
422 xfs_dir2_data_log_header(tp, bp); 421 xfs_dir2_data_log_header(tp, bp);
423 xfs_dir2_block_log_tail(tp, bp); 422 xfs_dir2_block_log_tail(tp, bp);
@@ -783,7 +782,7 @@ xfs_dir2_block_removename(
783 * Fix up bestfree, log the header if necessary. 782 * Fix up bestfree, log the header if necessary.
784 */ 783 */
785 if (needscan) 784 if (needscan)
786 xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog); 785 xfs_dir2_data_freescan(mp, hdr, &needlog);
787 if (needlog) 786 if (needlog)
788 xfs_dir2_data_log_header(tp, bp); 787 xfs_dir2_data_log_header(tp, bp);
789 xfs_dir2_data_check(dp, bp); 788 xfs_dir2_data_check(dp, bp);
@@ -982,7 +981,7 @@ xfs_dir2_leaf_to_block(
982 * Scan the bestfree if we need it and log the data block header. 981 * Scan the bestfree if we need it and log the data block header.
983 */ 982 */
984 if (needscan) 983 if (needscan)
985 xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog); 984 xfs_dir2_data_freescan(mp, hdr, &needlog);
986 if (needlog) 985 if (needlog)
987 xfs_dir2_data_log_header(tp, dbp); 986 xfs_dir2_data_log_header(tp, dbp);
988 /* 987 /*
@@ -1177,8 +1176,7 @@ xfs_dir2_sf_to_block(
1177 *xfs_dir2_data_unused_tag_p(dup) = cpu_to_be16( 1176 *xfs_dir2_data_unused_tag_p(dup) = cpu_to_be16(
1178 ((char *)dup - (char *)hdr)); 1177 ((char *)dup - (char *)hdr));
1179 xfs_dir2_data_log_unused(tp, bp, dup); 1178 xfs_dir2_data_log_unused(tp, bp, dup);
1180 (void)xfs_dir2_data_freeinsert((xfs_dir2_data_t *)hdr, 1179 xfs_dir2_data_freeinsert(hdr, dup, &dummy);
1181 dup, &dummy);
1182 offset += be16_to_cpu(dup->length); 1180 offset += be16_to_cpu(dup->length);
1183 continue; 1181 continue;
1184 } 1182 }