diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-15 16:55:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-15 16:55:30 -0400 |
commit | de578188ed0161713c9515eeafa394296516ff27 (patch) | |
tree | f057bc023122191953fb873953116b3173114637 /fs/xfs | |
parent | 5160bcce5c3c80de7d8722511c144d3041409657 (diff) | |
parent | 6ef50fe9afae63d11220f3f66b5f4c75d09c8bf0 (diff) |
Merge tag 'xfs-5.1-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs cleanups from Darrick Wong:
"Here's a few more cleanups that trickled in for the merge window.
It's all fixes for static checker complaints and slowly unwinding
typedef usage. The four patches here have gone through a few days
worth of fstest runs with no new problems observed.
Summary:
- Fix some clang/smatch/sparse warnings about uninitialized
variables.
- Clean up some typedef usage"
* tag 'xfs-5.1-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: clean up xfs_dir2_leaf_addname
xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname
xfs: clean up xfs_dir2_leafn_add
xfs: Zero initialize highstale and lowstale in xfs_dir2_leafn_add
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_leaf.c | 37 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_node.c | 18 |
2 files changed, 25 insertions, 30 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c index 9a3767818c50..9c2a0a13ed61 100644 --- a/fs/xfs/libxfs/xfs_dir2_leaf.c +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c | |||
@@ -563,43 +563,40 @@ xfs_dir3_leaf_find_entry( | |||
563 | */ | 563 | */ |
564 | int /* error */ | 564 | int /* error */ |
565 | xfs_dir2_leaf_addname( | 565 | xfs_dir2_leaf_addname( |
566 | xfs_da_args_t *args) /* operation arguments */ | 566 | struct xfs_da_args *args) /* operation arguments */ |
567 | { | 567 | { |
568 | struct xfs_dir3_icleaf_hdr leafhdr; | ||
569 | struct xfs_trans *tp = args->trans; | ||
568 | __be16 *bestsp; /* freespace table in leaf */ | 570 | __be16 *bestsp; /* freespace table in leaf */ |
569 | int compact; /* need to compact leaves */ | 571 | __be16 *tagp; /* end of data entry */ |
570 | xfs_dir2_data_hdr_t *hdr; /* data block header */ | ||
571 | struct xfs_buf *dbp; /* data block buffer */ | 572 | struct xfs_buf *dbp; /* data block buffer */ |
572 | xfs_dir2_data_entry_t *dep; /* data block entry */ | 573 | struct xfs_buf *lbp; /* leaf's buffer */ |
573 | xfs_inode_t *dp; /* incore directory inode */ | 574 | struct xfs_dir2_leaf *leaf; /* leaf structure */ |
574 | xfs_dir2_data_unused_t *dup; /* data unused entry */ | 575 | struct xfs_inode *dp = args->dp; /* incore directory inode */ |
576 | struct xfs_dir2_data_hdr *hdr; /* data block header */ | ||
577 | struct xfs_dir2_data_entry *dep; /* data block entry */ | ||
578 | struct xfs_dir2_leaf_entry *lep; /* leaf entry table pointer */ | ||
579 | struct xfs_dir2_leaf_entry *ents; | ||
580 | struct xfs_dir2_data_unused *dup; /* data unused entry */ | ||
581 | struct xfs_dir2_leaf_tail *ltp; /* leaf tail pointer */ | ||
582 | struct xfs_dir2_data_free *bf; /* bestfree table */ | ||
583 | int compact; /* need to compact leaves */ | ||
575 | int error; /* error return value */ | 584 | int error; /* error return value */ |
576 | int grown; /* allocated new data block */ | 585 | int grown; /* allocated new data block */ |
577 | int highstale; /* index of next stale leaf */ | 586 | int highstale = 0; /* index of next stale leaf */ |
578 | int i; /* temporary, index */ | 587 | int i; /* temporary, index */ |
579 | int index; /* leaf table position */ | 588 | int index; /* leaf table position */ |
580 | struct xfs_buf *lbp; /* leaf's buffer */ | ||
581 | xfs_dir2_leaf_t *leaf; /* leaf structure */ | ||
582 | int length; /* length of new entry */ | 589 | int length; /* length of new entry */ |
583 | xfs_dir2_leaf_entry_t *lep; /* leaf entry table pointer */ | ||
584 | int lfloglow; /* low leaf logging index */ | 590 | int lfloglow; /* low leaf logging index */ |
585 | int lfloghigh; /* high leaf logging index */ | 591 | int lfloghigh; /* high leaf logging index */ |
586 | int lowstale; /* index of prev stale leaf */ | 592 | int lowstale = 0; /* index of prev stale leaf */ |
587 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail pointer */ | ||
588 | int needbytes; /* leaf block bytes needed */ | 593 | int needbytes; /* leaf block bytes needed */ |
589 | int needlog; /* need to log data header */ | 594 | int needlog; /* need to log data header */ |
590 | int needscan; /* need to rescan data free */ | 595 | int needscan; /* need to rescan data free */ |
591 | __be16 *tagp; /* end of data entry */ | ||
592 | xfs_trans_t *tp; /* transaction pointer */ | ||
593 | xfs_dir2_db_t use_block; /* data block number */ | 596 | xfs_dir2_db_t use_block; /* data block number */ |
594 | struct xfs_dir2_data_free *bf; /* bestfree table */ | ||
595 | struct xfs_dir2_leaf_entry *ents; | ||
596 | struct xfs_dir3_icleaf_hdr leafhdr; | ||
597 | 597 | ||
598 | trace_xfs_dir2_leaf_addname(args); | 598 | trace_xfs_dir2_leaf_addname(args); |
599 | 599 | ||
600 | dp = args->dp; | ||
601 | tp = args->trans; | ||
602 | |||
603 | error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); | 600 | error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); |
604 | if (error) | 601 | if (error) |
605 | return error; | 602 | return error; |
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c index 3b03703c5c3d..16731d2d684b 100644 --- a/fs/xfs/libxfs/xfs_dir2_node.c +++ b/fs/xfs/libxfs/xfs_dir2_node.c | |||
@@ -426,24 +426,22 @@ xfs_dir2_leaf_to_node( | |||
426 | static int /* error */ | 426 | static int /* error */ |
427 | xfs_dir2_leafn_add( | 427 | xfs_dir2_leafn_add( |
428 | struct xfs_buf *bp, /* leaf buffer */ | 428 | struct xfs_buf *bp, /* leaf buffer */ |
429 | xfs_da_args_t *args, /* operation arguments */ | 429 | struct xfs_da_args *args, /* operation arguments */ |
430 | int index) /* insertion pt for new entry */ | 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 | int compact; /* compacting stale leaves */ | 437 | int compact; /* compacting stale leaves */ |
433 | xfs_inode_t *dp; /* incore directory inode */ | 438 | int highstale = 0; /* next stale entry */ |
434 | int highstale; /* next stale entry */ | ||
435 | xfs_dir2_leaf_t *leaf; /* leaf structure */ | ||
436 | xfs_dir2_leaf_entry_t *lep; /* leaf entry */ | ||
437 | int lfloghigh; /* high leaf entry logging */ | 439 | int lfloghigh; /* high leaf entry logging */ |
438 | int lfloglow; /* low leaf entry logging */ | 440 | int lfloglow; /* low leaf entry logging */ |
439 | int lowstale; /* previous stale entry */ | 441 | int lowstale = 0; /* previous stale entry */ |
440 | struct xfs_dir3_icleaf_hdr leafhdr; | ||
441 | struct xfs_dir2_leaf_entry *ents; | ||
442 | 442 | ||
443 | trace_xfs_dir2_leafn_add(args, index); | 443 | trace_xfs_dir2_leafn_add(args, index); |
444 | 444 | ||
445 | dp = args->dp; | ||
446 | leaf = bp->b_addr; | ||
447 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); | 445 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); |
448 | ents = dp->d_ops->leaf_ents_p(leaf); | 446 | ents = dp->d_ops->leaf_ents_p(leaf); |
449 | 447 | ||