Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2066e26 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent a64b0417
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -2079,16 +2079,13 @@ xfs_da_do_buf(
	 * For read_buf, check the magic number.
	 */
	if (caller == 1) {
		xfs_dir2_data_t		*data;
		xfs_dir2_free_t		*free;
		xfs_da_blkinfo_t	*info;
		xfs_dir2_data_hdr_t	*hdr = rbp->data;
		xfs_dir2_free_t		*free = rbp->data;
		xfs_da_blkinfo_t	*info = rbp->data;
		uint			magic, magic1;

		info = rbp->data;
		data = rbp->data;
		free = rbp->data;
		magic = be16_to_cpu(info->magic);
		magic1 = be32_to_cpu(data->hdr.magic);
		magic1 = be32_to_cpu(hdr->magic);
		if (unlikely(
		    XFS_TEST_ERROR((magic != XFS_DA_NODE_MAGIC) &&
				   (magic != XFS_ATTR_LEAF_MAGIC) &&
+6 −8
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ xfs_dir2_block_addname(
		 * This needs to happen before the next call to use_free.
		 */
		if (needscan) {
			xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog);
			xfs_dir2_data_freescan(mp, hdr, &needlog);
			needscan = 0;
		}
	}
@@ -331,8 +331,7 @@ xfs_dir2_block_addname(
		 * This needs to happen before the next call to use_free.
		 */
		if (needscan) {
			xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr,
				&needlog);
			xfs_dir2_data_freescan(mp, hdr, &needlog);
			needscan = 0;
		}
		/*
@@ -417,7 +416,7 @@ xfs_dir2_block_addname(
	 * Clean up the bestfree array and log the header, tail, and entry.
	 */
	if (needscan)
		xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog);
		xfs_dir2_data_freescan(mp, hdr, &needlog);
	if (needlog)
		xfs_dir2_data_log_header(tp, bp);
	xfs_dir2_block_log_tail(tp, bp);
@@ -783,7 +782,7 @@ xfs_dir2_block_removename(
	 * Fix up bestfree, log the header if necessary.
	 */
	if (needscan)
		xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog);
		xfs_dir2_data_freescan(mp, hdr, &needlog);
	if (needlog)
		xfs_dir2_data_log_header(tp, bp);
	xfs_dir2_data_check(dp, bp);
@@ -982,7 +981,7 @@ xfs_dir2_leaf_to_block(
	 * Scan the bestfree if we need it and log the data block header.
	 */
	if (needscan)
		xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog);
		xfs_dir2_data_freescan(mp, hdr, &needlog);
	if (needlog)
		xfs_dir2_data_log_header(tp, dbp);
	/*
@@ -1177,8 +1176,7 @@ xfs_dir2_sf_to_block(
			*xfs_dir2_data_unused_tag_p(dup) = cpu_to_be16(
				((char *)dup - (char *)hdr));
			xfs_dir2_data_log_unused(tp, bp, dup);
			(void)xfs_dir2_data_freeinsert((xfs_dir2_data_t *)hdr,
				dup, &dummy);
			xfs_dir2_data_freeinsert(hdr, dup, &dummy);
			offset += be16_to_cpu(dup->length);
			continue;
		}
Loading