]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: clean up xfs_dir2_leafn_add
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 6 May 2019 22:00:29 +0000 (18:00 -0400)
committerEric Sandeen <sandeen@redhat.com>
Mon, 6 May 2019 22:00:29 +0000 (18:00 -0400)
Source kernel commit: 79622c7ce6879c25ce121ee0db91c0ac4c7b137c

Remove typedefs and consolidate local variable initialization.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_dir2_node.c

index 3d085a4616e591d17420090326b437af8c79d60f..2de174c06b68f9b1e91045d5d0be2c4355da05da 100644 (file)
@@ -423,26 +423,22 @@ xfs_dir2_leaf_to_node(
 static int                                     /* error */
 xfs_dir2_leafn_add(
        struct xfs_buf          *bp,            /* leaf buffer */
-       xfs_da_args_t           *args,          /* operation arguments */
+       struct xfs_da_args      *args,          /* operation arguments */
        int                     index)          /* insertion pt for new entry */
 {
+       struct xfs_dir3_icleaf_hdr leafhdr;
+       struct xfs_inode        *dp = args->dp;
+       struct xfs_dir2_leaf    *leaf = bp->b_addr;
+       struct xfs_dir2_leaf_entry *lep;
+       struct xfs_dir2_leaf_entry *ents;
        int                     compact;        /* compacting stale leaves */
-       xfs_inode_t             *dp;            /* incore directory inode */
-       int                     highstale;      /* next stale entry */
-       xfs_dir2_leaf_t         *leaf;          /* leaf structure */
-       xfs_dir2_leaf_entry_t   *lep;           /* leaf entry */
+       int                     highstale = 0;  /* next stale entry */
        int                     lfloghigh;      /* high leaf entry logging */
        int                     lfloglow;       /* low leaf entry logging */
-       int                     lowstale;       /* previous stale entry */
-       struct xfs_dir3_icleaf_hdr leafhdr;
-       struct xfs_dir2_leaf_entry *ents;
+       int                     lowstale = 0;   /* previous stale entry */
 
        trace_xfs_dir2_leafn_add(args, index);
 
-       dp = args->dp;
-       leaf = bp->b_addr;
-       highstale = 0;
-       lowstale = 0;
        dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);