Skip to content

Commit 79622c7

Browse files
committed
xfs: clean up xfs_dir2_leafn_add
Remove typedefs and consolidate local variable initialization. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
1 parent 7be73fa commit 79622c7

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

fs/xfs/libxfs/xfs_dir2_node.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -426,26 +426,22 @@ xfs_dir2_leaf_to_node(
426426
static int /* error */
427427
xfs_dir2_leafn_add(
428428
struct xfs_buf *bp, /* leaf buffer */
429-
xfs_da_args_t *args, /* operation arguments */
429+
struct xfs_da_args *args, /* operation arguments */
430430
int index) /* insertion pt for new entry */
431431
{
432+
struct xfs_dir3_icleaf_hdr leafhdr;
433+
struct xfs_inode *dp = args->dp;
434+
struct xfs_dir2_leaf *leaf = bp->b_addr;
435+
struct xfs_dir2_leaf_entry *lep;
436+
struct xfs_dir2_leaf_entry *ents;
432437
int compact; /* compacting stale leaves */
433-
xfs_inode_t *dp; /* incore directory inode */
434-
int highstale; /* next stale entry */
435-
xfs_dir2_leaf_t *leaf; /* leaf structure */
436-
xfs_dir2_leaf_entry_t *lep; /* leaf entry */
438+
int highstale = 0; /* next stale entry */
437439
int lfloghigh; /* high leaf entry logging */
438440
int lfloglow; /* low leaf entry logging */
439-
int lowstale; /* previous stale entry */
440-
struct xfs_dir3_icleaf_hdr leafhdr;
441-
struct xfs_dir2_leaf_entry *ents;
441+
int lowstale = 0; /* previous stale entry */
442442

443443
trace_xfs_dir2_leafn_add(args, index);
444444

445-
dp = args->dp;
446-
leaf = bp->b_addr;
447-
highstale = 0;
448-
lowstale = 0;
449445
dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
450446
ents = dp->d_ops->leaf_ents_p(leaf);
451447

0 commit comments

Comments
 (0)