xfs: clean up xfs_dir2_leaf_addname
Remove typedefs and consolidate local variable initialization. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Bill O'Donnell <billodo@redhat.com>
This commit is contained in:
@@ -563,43 +563,40 @@ xfs_dir3_leaf_find_entry(
|
|||||||
*/
|
*/
|
||||||
int /* error */
|
int /* error */
|
||||||
xfs_dir2_leaf_addname(
|
xfs_dir2_leaf_addname(
|
||||||
xfs_da_args_t *args) /* operation arguments */
|
struct xfs_da_args *args) /* operation arguments */
|
||||||
{
|
{
|
||||||
|
struct xfs_dir3_icleaf_hdr leafhdr;
|
||||||
|
struct xfs_trans *tp = args->trans;
|
||||||
__be16 *bestsp; /* freespace table in leaf */
|
__be16 *bestsp; /* freespace table in leaf */
|
||||||
int compact; /* need to compact leaves */
|
__be16 *tagp; /* end of data entry */
|
||||||
xfs_dir2_data_hdr_t *hdr; /* data block header */
|
|
||||||
struct xfs_buf *dbp; /* data block buffer */
|
struct xfs_buf *dbp; /* data block buffer */
|
||||||
xfs_dir2_data_entry_t *dep; /* data block entry */
|
struct xfs_buf *lbp; /* leaf's buffer */
|
||||||
xfs_inode_t *dp; /* incore directory inode */
|
struct xfs_dir2_leaf *leaf; /* leaf structure */
|
||||||
xfs_dir2_data_unused_t *dup; /* data unused entry */
|
struct xfs_inode *dp = args->dp; /* incore directory inode */
|
||||||
|
struct xfs_dir2_data_hdr *hdr; /* data block header */
|
||||||
|
struct xfs_dir2_data_entry *dep; /* data block entry */
|
||||||
|
struct xfs_dir2_leaf_entry *lep; /* leaf entry table pointer */
|
||||||
|
struct xfs_dir2_leaf_entry *ents;
|
||||||
|
struct xfs_dir2_data_unused *dup; /* data unused entry */
|
||||||
|
struct xfs_dir2_leaf_tail *ltp; /* leaf tail pointer */
|
||||||
|
struct xfs_dir2_data_free *bf; /* bestfree table */
|
||||||
|
int compact; /* need to compact leaves */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
int grown; /* allocated new data block */
|
int grown; /* allocated new data block */
|
||||||
int highstale = 0; /* index of next stale leaf */
|
int highstale = 0; /* index of next stale leaf */
|
||||||
int i; /* temporary, index */
|
int i; /* temporary, index */
|
||||||
int index; /* leaf table position */
|
int index; /* leaf table position */
|
||||||
struct xfs_buf *lbp; /* leaf's buffer */
|
|
||||||
xfs_dir2_leaf_t *leaf; /* leaf structure */
|
|
||||||
int length; /* length of new entry */
|
int length; /* length of new entry */
|
||||||
xfs_dir2_leaf_entry_t *lep; /* leaf entry table pointer */
|
|
||||||
int lfloglow; /* low leaf logging index */
|
int lfloglow; /* low leaf logging index */
|
||||||
int lfloghigh; /* high leaf logging index */
|
int lfloghigh; /* high leaf logging index */
|
||||||
int lowstale = 0; /* index of prev stale leaf */
|
int lowstale = 0; /* index of prev stale leaf */
|
||||||
xfs_dir2_leaf_tail_t *ltp; /* leaf tail pointer */
|
|
||||||
int needbytes; /* leaf block bytes needed */
|
int needbytes; /* leaf block bytes needed */
|
||||||
int needlog; /* need to log data header */
|
int needlog; /* need to log data header */
|
||||||
int needscan; /* need to rescan data free */
|
int needscan; /* need to rescan data free */
|
||||||
__be16 *tagp; /* end of data entry */
|
|
||||||
xfs_trans_t *tp; /* transaction pointer */
|
|
||||||
xfs_dir2_db_t use_block; /* data block number */
|
xfs_dir2_db_t use_block; /* data block number */
|
||||||
struct xfs_dir2_data_free *bf; /* bestfree table */
|
|
||||||
struct xfs_dir2_leaf_entry *ents;
|
|
||||||
struct xfs_dir3_icleaf_hdr leafhdr;
|
|
||||||
|
|
||||||
trace_xfs_dir2_leaf_addname(args);
|
trace_xfs_dir2_leaf_addname(args);
|
||||||
|
|
||||||
dp = args->dp;
|
|
||||||
tp = args->trans;
|
|
||||||
|
|
||||||
error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp);
|
error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|||||||
Reference in New Issue
Block a user