Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+8 -12
+8 -12
fs/xfs/libxfs/xfs_dir2_node.c
··· 426 426 static int /* error */ 427 427 xfs_dir2_leafn_add( 428 428 struct xfs_buf *bp, /* leaf buffer */ 429 - xfs_da_args_t *args, /* operation arguments */ 429 + struct xfs_da_args *args, /* operation arguments */ 430 430 int index) /* insertion pt for new entry */ 431 431 { 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; 432 437 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 */ 437 439 int lfloghigh; /* high leaf entry logging */ 438 440 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 */ 442 442 443 443 trace_xfs_dir2_leafn_add(args, index); 444 444 445 - dp = args->dp; 446 - leaf = bp->b_addr; 447 - highstale = 0; 448 - lowstale = 0; 449 445 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); 450 446 ents = dp->d_ops->leaf_ents_p(leaf); 451 447