diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-12-03 17:43:17 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-12-03 17:43:17 -0500 |
commit | 32296f865e8d41ff8c337ce6f0b97eeda08988a3 (patch) | |
tree | e4e2bb6a1db23d836cb081c5de61c4e46c9df543 /fs/xfs | |
parent | 9a2cc41cda189bea1fb9c41ef64d19949d3b2bcd (diff) |
xfs: fix set-but-unused warnings
The kernel compile doesn't turn on these checks by default, so it's
only when I do a kernel-user sync that I find that there are lots of
compiler warnings waiting to be fixed. Fix up these set-but-unused
warnings.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 2 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_da_btree.c | 4 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_block.c | 8 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_leaf.c | 10 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_node.c | 12 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_sf.c | 10 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 12 | ||||
-rw-r--r-- | fs/xfs/xfs_iomap.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_itable.c | 2 |
9 files changed, 2 insertions, 60 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 5a42e2ba857f..a0a4db80a4a6 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c | |||
@@ -5450,13 +5450,11 @@ xfs_bmse_merge( | |||
5450 | struct xfs_btree_cur *cur, | 5450 | struct xfs_btree_cur *cur, |
5451 | int *logflags) /* output */ | 5451 | int *logflags) /* output */ |
5452 | { | 5452 | { |
5453 | struct xfs_ifork *ifp; | ||
5454 | struct xfs_bmbt_irec got; | 5453 | struct xfs_bmbt_irec got; |
5455 | struct xfs_bmbt_irec left; | 5454 | struct xfs_bmbt_irec left; |
5456 | xfs_filblks_t blockcount; | 5455 | xfs_filblks_t blockcount; |
5457 | int error, i; | 5456 | int error, i; |
5458 | 5457 | ||
5459 | ifp = XFS_IFORK_PTR(ip, whichfork); | ||
5460 | xfs_bmbt_get_all(gotp, &got); | 5458 | xfs_bmbt_get_all(gotp, &got); |
5461 | xfs_bmbt_get_all(leftp, &left); | 5459 | xfs_bmbt_get_all(leftp, &left); |
5462 | blockcount = left.br_blockcount + got.br_blockcount; | 5460 | blockcount = left.br_blockcount + got.br_blockcount; |
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c index fd827530afec..50cdc32aed1b 100644 --- a/fs/xfs/libxfs/xfs_da_btree.c +++ b/fs/xfs/libxfs/xfs_da_btree.c | |||
@@ -514,7 +514,6 @@ xfs_da3_root_split( | |||
514 | struct xfs_buf *bp; | 514 | struct xfs_buf *bp; |
515 | struct xfs_inode *dp; | 515 | struct xfs_inode *dp; |
516 | struct xfs_trans *tp; | 516 | struct xfs_trans *tp; |
517 | struct xfs_mount *mp; | ||
518 | struct xfs_dir2_leaf *leaf; | 517 | struct xfs_dir2_leaf *leaf; |
519 | xfs_dablk_t blkno; | 518 | xfs_dablk_t blkno; |
520 | int level; | 519 | int level; |
@@ -534,7 +533,6 @@ xfs_da3_root_split( | |||
534 | 533 | ||
535 | dp = args->dp; | 534 | dp = args->dp; |
536 | tp = args->trans; | 535 | tp = args->trans; |
537 | mp = state->mp; | ||
538 | error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, args->whichfork); | 536 | error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, args->whichfork); |
539 | if (error) | 537 | if (error) |
540 | return error; | 538 | return error; |
@@ -2342,14 +2340,12 @@ xfs_da_shrink_inode( | |||
2342 | xfs_inode_t *dp; | 2340 | xfs_inode_t *dp; |
2343 | int done, error, w, count; | 2341 | int done, error, w, count; |
2344 | xfs_trans_t *tp; | 2342 | xfs_trans_t *tp; |
2345 | xfs_mount_t *mp; | ||
2346 | 2343 | ||
2347 | trace_xfs_da_shrink_inode(args); | 2344 | trace_xfs_da_shrink_inode(args); |
2348 | 2345 | ||
2349 | dp = args->dp; | 2346 | dp = args->dp; |
2350 | w = args->whichfork; | 2347 | w = args->whichfork; |
2351 | tp = args->trans; | 2348 | tp = args->trans; |
2352 | mp = dp->i_mount; | ||
2353 | count = args->geo->fsbcount; | 2349 | count = args->geo->fsbcount; |
2354 | for (;;) { | 2350 | for (;;) { |
2355 | /* | 2351 | /* |
diff --git a/fs/xfs/libxfs/xfs_dir2_block.c b/fs/xfs/libxfs/xfs_dir2_block.c index 9628ceccfa02..d8cfc3f2a224 100644 --- a/fs/xfs/libxfs/xfs_dir2_block.c +++ b/fs/xfs/libxfs/xfs_dir2_block.c | |||
@@ -353,7 +353,6 @@ xfs_dir2_block_addname( | |||
353 | int low; /* low index for binary srch */ | 353 | int low; /* low index for binary srch */ |
354 | int lowstale; /* low stale index */ | 354 | int lowstale; /* low stale index */ |
355 | int mid=0; /* midpoint for binary srch */ | 355 | int mid=0; /* midpoint for binary srch */ |
356 | xfs_mount_t *mp; /* filesystem mount point */ | ||
357 | int needlog; /* need to log header */ | 356 | int needlog; /* need to log header */ |
358 | int needscan; /* need to rescan freespace */ | 357 | int needscan; /* need to rescan freespace */ |
359 | __be16 *tagp; /* pointer to tag value */ | 358 | __be16 *tagp; /* pointer to tag value */ |
@@ -363,7 +362,6 @@ xfs_dir2_block_addname( | |||
363 | 362 | ||
364 | dp = args->dp; | 363 | dp = args->dp; |
365 | tp = args->trans; | 364 | tp = args->trans; |
366 | mp = dp->i_mount; | ||
367 | 365 | ||
368 | /* Read the (one and only) directory block into bp. */ | 366 | /* Read the (one and only) directory block into bp. */ |
369 | error = xfs_dir3_block_read(tp, dp, &bp); | 367 | error = xfs_dir3_block_read(tp, dp, &bp); |
@@ -618,7 +616,6 @@ xfs_dir2_block_lookup( | |||
618 | xfs_inode_t *dp; /* incore inode */ | 616 | xfs_inode_t *dp; /* incore inode */ |
619 | int ent; /* entry index */ | 617 | int ent; /* entry index */ |
620 | int error; /* error return value */ | 618 | int error; /* error return value */ |
621 | xfs_mount_t *mp; /* filesystem mount point */ | ||
622 | 619 | ||
623 | trace_xfs_dir2_block_lookup(args); | 620 | trace_xfs_dir2_block_lookup(args); |
624 | 621 | ||
@@ -629,7 +626,6 @@ xfs_dir2_block_lookup( | |||
629 | if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent))) | 626 | if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent))) |
630 | return error; | 627 | return error; |
631 | dp = args->dp; | 628 | dp = args->dp; |
632 | mp = dp->i_mount; | ||
633 | hdr = bp->b_addr; | 629 | hdr = bp->b_addr; |
634 | xfs_dir3_data_check(dp, bp); | 630 | xfs_dir3_data_check(dp, bp); |
635 | btp = xfs_dir2_block_tail_p(args->geo, hdr); | 631 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
@@ -770,7 +766,6 @@ xfs_dir2_block_removename( | |||
770 | xfs_inode_t *dp; /* incore inode */ | 766 | xfs_inode_t *dp; /* incore inode */ |
771 | int ent; /* block leaf entry index */ | 767 | int ent; /* block leaf entry index */ |
772 | int error; /* error return value */ | 768 | int error; /* error return value */ |
773 | xfs_mount_t *mp; /* filesystem mount point */ | ||
774 | int needlog; /* need to log block header */ | 769 | int needlog; /* need to log block header */ |
775 | int needscan; /* need to fixup bestfree */ | 770 | int needscan; /* need to fixup bestfree */ |
776 | xfs_dir2_sf_hdr_t sfh; /* shortform header */ | 771 | xfs_dir2_sf_hdr_t sfh; /* shortform header */ |
@@ -788,7 +783,6 @@ xfs_dir2_block_removename( | |||
788 | } | 783 | } |
789 | dp = args->dp; | 784 | dp = args->dp; |
790 | tp = args->trans; | 785 | tp = args->trans; |
791 | mp = dp->i_mount; | ||
792 | hdr = bp->b_addr; | 786 | hdr = bp->b_addr; |
793 | btp = xfs_dir2_block_tail_p(args->geo, hdr); | 787 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
794 | blp = xfs_dir2_block_leaf_p(btp); | 788 | blp = xfs_dir2_block_leaf_p(btp); |
@@ -852,7 +846,6 @@ xfs_dir2_block_replace( | |||
852 | xfs_inode_t *dp; /* incore inode */ | 846 | xfs_inode_t *dp; /* incore inode */ |
853 | int ent; /* leaf entry index */ | 847 | int ent; /* leaf entry index */ |
854 | int error; /* error return value */ | 848 | int error; /* error return value */ |
855 | xfs_mount_t *mp; /* filesystem mount point */ | ||
856 | 849 | ||
857 | trace_xfs_dir2_block_replace(args); | 850 | trace_xfs_dir2_block_replace(args); |
858 | 851 | ||
@@ -864,7 +857,6 @@ xfs_dir2_block_replace( | |||
864 | return error; | 857 | return error; |
865 | } | 858 | } |
866 | dp = args->dp; | 859 | dp = args->dp; |
867 | mp = dp->i_mount; | ||
868 | hdr = bp->b_addr; | 860 | hdr = bp->b_addr; |
869 | btp = xfs_dir2_block_tail_p(args->geo, hdr); | 861 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
870 | blp = xfs_dir2_block_leaf_p(btp); | 862 | blp = xfs_dir2_block_leaf_p(btp); |
diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c index a19174eb3cb2..e333fa1257c5 100644 --- a/fs/xfs/libxfs/xfs_dir2_leaf.c +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c | |||
@@ -384,7 +384,6 @@ xfs_dir2_block_to_leaf( | |||
384 | xfs_dir2_db_t ldb; /* leaf block's bno */ | 384 | xfs_dir2_db_t ldb; /* leaf block's bno */ |
385 | xfs_dir2_leaf_t *leaf; /* leaf structure */ | 385 | xfs_dir2_leaf_t *leaf; /* leaf structure */ |
386 | xfs_dir2_leaf_tail_t *ltp; /* leaf's tail */ | 386 | xfs_dir2_leaf_tail_t *ltp; /* leaf's tail */ |
387 | xfs_mount_t *mp; /* filesystem mount point */ | ||
388 | int needlog; /* need to log block header */ | 387 | int needlog; /* need to log block header */ |
389 | int needscan; /* need to rescan bestfree */ | 388 | int needscan; /* need to rescan bestfree */ |
390 | xfs_trans_t *tp; /* transaction pointer */ | 389 | xfs_trans_t *tp; /* transaction pointer */ |
@@ -395,7 +394,6 @@ xfs_dir2_block_to_leaf( | |||
395 | trace_xfs_dir2_block_to_leaf(args); | 394 | trace_xfs_dir2_block_to_leaf(args); |
396 | 395 | ||
397 | dp = args->dp; | 396 | dp = args->dp; |
398 | mp = dp->i_mount; | ||
399 | tp = args->trans; | 397 | tp = args->trans; |
400 | /* | 398 | /* |
401 | * Add the leaf block to the inode. | 399 | * Add the leaf block to the inode. |
@@ -626,7 +624,6 @@ xfs_dir2_leaf_addname( | |||
626 | int lfloghigh; /* high leaf logging index */ | 624 | int lfloghigh; /* high leaf logging index */ |
627 | int lowstale; /* index of prev stale leaf */ | 625 | int lowstale; /* index of prev stale leaf */ |
628 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail pointer */ | 626 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail pointer */ |
629 | xfs_mount_t *mp; /* filesystem mount point */ | ||
630 | int needbytes; /* leaf block bytes needed */ | 627 | int needbytes; /* leaf block bytes needed */ |
631 | int needlog; /* need to log data header */ | 628 | int needlog; /* need to log data header */ |
632 | int needscan; /* need to rescan data free */ | 629 | int needscan; /* need to rescan data free */ |
@@ -641,7 +638,6 @@ xfs_dir2_leaf_addname( | |||
641 | 638 | ||
642 | dp = args->dp; | 639 | dp = args->dp; |
643 | tp = args->trans; | 640 | tp = args->trans; |
644 | mp = dp->i_mount; | ||
645 | 641 | ||
646 | error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); | 642 | error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); |
647 | if (error) | 643 | if (error) |
@@ -1356,11 +1352,9 @@ xfs_dir2_leaf_removename( | |||
1356 | xfs_dir2_leaf_t *leaf; /* leaf structure */ | 1352 | xfs_dir2_leaf_t *leaf; /* leaf structure */ |
1357 | xfs_dir2_leaf_entry_t *lep; /* leaf entry */ | 1353 | xfs_dir2_leaf_entry_t *lep; /* leaf entry */ |
1358 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ | 1354 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ |
1359 | xfs_mount_t *mp; /* filesystem mount point */ | ||
1360 | int needlog; /* need to log data header */ | 1355 | int needlog; /* need to log data header */ |
1361 | int needscan; /* need to rescan data frees */ | 1356 | int needscan; /* need to rescan data frees */ |
1362 | xfs_dir2_data_off_t oldbest; /* old value of best free */ | 1357 | xfs_dir2_data_off_t oldbest; /* old value of best free */ |
1363 | xfs_trans_t *tp; /* transaction pointer */ | ||
1364 | struct xfs_dir2_data_free *bf; /* bestfree table */ | 1358 | struct xfs_dir2_data_free *bf; /* bestfree table */ |
1365 | struct xfs_dir2_leaf_entry *ents; | 1359 | struct xfs_dir2_leaf_entry *ents; |
1366 | struct xfs_dir3_icleaf_hdr leafhdr; | 1360 | struct xfs_dir3_icleaf_hdr leafhdr; |
@@ -1374,8 +1368,6 @@ xfs_dir2_leaf_removename( | |||
1374 | return error; | 1368 | return error; |
1375 | } | 1369 | } |
1376 | dp = args->dp; | 1370 | dp = args->dp; |
1377 | tp = args->trans; | ||
1378 | mp = dp->i_mount; | ||
1379 | leaf = lbp->b_addr; | 1371 | leaf = lbp->b_addr; |
1380 | hdr = dbp->b_addr; | 1372 | hdr = dbp->b_addr; |
1381 | xfs_dir3_data_check(dp, dbp); | 1373 | xfs_dir3_data_check(dp, dbp); |
@@ -1607,11 +1599,9 @@ xfs_dir2_leaf_trim_data( | |||
1607 | int error; /* error return value */ | 1599 | int error; /* error return value */ |
1608 | xfs_dir2_leaf_t *leaf; /* leaf structure */ | 1600 | xfs_dir2_leaf_t *leaf; /* leaf structure */ |
1609 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ | 1601 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ |
1610 | xfs_mount_t *mp; /* filesystem mount point */ | ||
1611 | xfs_trans_t *tp; /* transaction pointer */ | 1602 | xfs_trans_t *tp; /* transaction pointer */ |
1612 | 1603 | ||
1613 | dp = args->dp; | 1604 | dp = args->dp; |
1614 | mp = dp->i_mount; | ||
1615 | tp = args->trans; | 1605 | tp = args->trans; |
1616 | /* | 1606 | /* |
1617 | * Read the offending data block. We need its buffer. | 1607 | * Read the offending data block. We need its buffer. |
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c index 2ae6ac2c11ae..afcb7753b61c 100644 --- a/fs/xfs/libxfs/xfs_dir2_node.c +++ b/fs/xfs/libxfs/xfs_dir2_node.c | |||
@@ -297,7 +297,6 @@ xfs_dir2_leaf_to_node( | |||
297 | int i; /* leaf freespace index */ | 297 | int i; /* leaf freespace index */ |
298 | xfs_dir2_leaf_t *leaf; /* leaf structure */ | 298 | xfs_dir2_leaf_t *leaf; /* leaf structure */ |
299 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ | 299 | xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ |
300 | xfs_mount_t *mp; /* filesystem mount point */ | ||
301 | int n; /* count of live freespc ents */ | 300 | int n; /* count of live freespc ents */ |
302 | xfs_dir2_data_off_t off; /* freespace entry value */ | 301 | xfs_dir2_data_off_t off; /* freespace entry value */ |
303 | __be16 *to; /* pointer to freespace entry */ | 302 | __be16 *to; /* pointer to freespace entry */ |
@@ -307,7 +306,6 @@ xfs_dir2_leaf_to_node( | |||
307 | trace_xfs_dir2_leaf_to_node(args); | 306 | trace_xfs_dir2_leaf_to_node(args); |
308 | 307 | ||
309 | dp = args->dp; | 308 | dp = args->dp; |
310 | mp = dp->i_mount; | ||
311 | tp = args->trans; | 309 | tp = args->trans; |
312 | /* | 310 | /* |
313 | * Add a freespace block to the directory. | 311 | * Add a freespace block to the directory. |
@@ -387,16 +385,12 @@ xfs_dir2_leafn_add( | |||
387 | int lfloghigh; /* high leaf entry logging */ | 385 | int lfloghigh; /* high leaf entry logging */ |
388 | int lfloglow; /* low leaf entry logging */ | 386 | int lfloglow; /* low leaf entry logging */ |
389 | int lowstale; /* previous stale entry */ | 387 | int lowstale; /* previous stale entry */ |
390 | xfs_mount_t *mp; /* filesystem mount point */ | ||
391 | xfs_trans_t *tp; /* transaction pointer */ | ||
392 | struct xfs_dir3_icleaf_hdr leafhdr; | 388 | struct xfs_dir3_icleaf_hdr leafhdr; |
393 | struct xfs_dir2_leaf_entry *ents; | 389 | struct xfs_dir2_leaf_entry *ents; |
394 | 390 | ||
395 | trace_xfs_dir2_leafn_add(args, index); | 391 | trace_xfs_dir2_leafn_add(args, index); |
396 | 392 | ||
397 | dp = args->dp; | 393 | dp = args->dp; |
398 | mp = dp->i_mount; | ||
399 | tp = args->trans; | ||
400 | leaf = bp->b_addr; | 394 | leaf = bp->b_addr; |
401 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); | 395 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); |
402 | ents = dp->d_ops->leaf_ents_p(leaf); | 396 | ents = dp->d_ops->leaf_ents_p(leaf); |
@@ -1170,7 +1164,6 @@ xfs_dir2_leafn_remove( | |||
1170 | xfs_dir2_leaf_entry_t *lep; /* leaf entry */ | 1164 | xfs_dir2_leaf_entry_t *lep; /* leaf entry */ |
1171 | int longest; /* longest data free entry */ | 1165 | int longest; /* longest data free entry */ |
1172 | int off; /* data block entry offset */ | 1166 | int off; /* data block entry offset */ |
1173 | xfs_mount_t *mp; /* filesystem mount point */ | ||
1174 | int needlog; /* need to log data header */ | 1167 | int needlog; /* need to log data header */ |
1175 | int needscan; /* need to rescan data frees */ | 1168 | int needscan; /* need to rescan data frees */ |
1176 | xfs_trans_t *tp; /* transaction pointer */ | 1169 | xfs_trans_t *tp; /* transaction pointer */ |
@@ -1182,7 +1175,6 @@ xfs_dir2_leafn_remove( | |||
1182 | 1175 | ||
1183 | dp = args->dp; | 1176 | dp = args->dp; |
1184 | tp = args->trans; | 1177 | tp = args->trans; |
1185 | mp = dp->i_mount; | ||
1186 | leaf = bp->b_addr; | 1178 | leaf = bp->b_addr; |
1187 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); | 1179 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); |
1188 | ents = dp->d_ops->leaf_ents_p(leaf); | 1180 | ents = dp->d_ops->leaf_ents_p(leaf); |
@@ -1323,7 +1315,6 @@ xfs_dir2_leafn_split( | |||
1323 | xfs_da_args_t *args; /* operation arguments */ | 1315 | xfs_da_args_t *args; /* operation arguments */ |
1324 | xfs_dablk_t blkno; /* new leaf block number */ | 1316 | xfs_dablk_t blkno; /* new leaf block number */ |
1325 | int error; /* error return value */ | 1317 | int error; /* error return value */ |
1326 | xfs_mount_t *mp; /* filesystem mount point */ | ||
1327 | struct xfs_inode *dp; | 1318 | struct xfs_inode *dp; |
1328 | 1319 | ||
1329 | /* | 1320 | /* |
@@ -1331,7 +1322,6 @@ xfs_dir2_leafn_split( | |||
1331 | */ | 1322 | */ |
1332 | args = state->args; | 1323 | args = state->args; |
1333 | dp = args->dp; | 1324 | dp = args->dp; |
1334 | mp = dp->i_mount; | ||
1335 | ASSERT(oldblk->magic == XFS_DIR2_LEAFN_MAGIC); | 1325 | ASSERT(oldblk->magic == XFS_DIR2_LEAFN_MAGIC); |
1336 | error = xfs_da_grow_inode(args, &blkno); | 1326 | error = xfs_da_grow_inode(args, &blkno); |
1337 | if (error) { | 1327 | if (error) { |
@@ -2231,12 +2221,10 @@ xfs_dir2_node_trim_free( | |||
2231 | xfs_inode_t *dp; /* incore directory inode */ | 2221 | xfs_inode_t *dp; /* incore directory inode */ |
2232 | int error; /* error return code */ | 2222 | int error; /* error return code */ |
2233 | xfs_dir2_free_t *free; /* freespace structure */ | 2223 | xfs_dir2_free_t *free; /* freespace structure */ |
2234 | xfs_mount_t *mp; /* filesystem mount point */ | ||
2235 | xfs_trans_t *tp; /* transaction pointer */ | 2224 | xfs_trans_t *tp; /* transaction pointer */ |
2236 | struct xfs_dir3_icfree_hdr freehdr; | 2225 | struct xfs_dir3_icfree_hdr freehdr; |
2237 | 2226 | ||
2238 | dp = args->dp; | 2227 | dp = args->dp; |
2239 | mp = dp->i_mount; | ||
2240 | tp = args->trans; | 2228 | tp = args->trans; |
2241 | /* | 2229 | /* |
2242 | * Read the freespace block. | 2230 | * Read the freespace block. |
diff --git a/fs/xfs/libxfs/xfs_dir2_sf.c b/fs/xfs/libxfs/xfs_dir2_sf.c index 5079e051ef08..d0863d44d80d 100644 --- a/fs/xfs/libxfs/xfs_dir2_sf.c +++ b/fs/xfs/libxfs/xfs_dir2_sf.c | |||
@@ -455,13 +455,11 @@ xfs_dir2_sf_addname_hard( | |||
455 | xfs_dir2_sf_hdr_t *oldsfp; /* original shortform dir */ | 455 | xfs_dir2_sf_hdr_t *oldsfp; /* original shortform dir */ |
456 | xfs_dir2_sf_entry_t *sfep; /* entry in new dir */ | 456 | xfs_dir2_sf_entry_t *sfep; /* entry in new dir */ |
457 | xfs_dir2_sf_hdr_t *sfp; /* new shortform dir */ | 457 | xfs_dir2_sf_hdr_t *sfp; /* new shortform dir */ |
458 | struct xfs_mount *mp; | ||
459 | 458 | ||
460 | /* | 459 | /* |
461 | * Copy the old directory to the stack buffer. | 460 | * Copy the old directory to the stack buffer. |
462 | */ | 461 | */ |
463 | dp = args->dp; | 462 | dp = args->dp; |
464 | mp = dp->i_mount; | ||
465 | 463 | ||
466 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; | 464 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
467 | old_isize = (int)dp->i_d.di_size; | 465 | old_isize = (int)dp->i_d.di_size; |
@@ -542,7 +540,6 @@ xfs_dir2_sf_addname_pick( | |||
542 | xfs_inode_t *dp; /* incore directory inode */ | 540 | xfs_inode_t *dp; /* incore directory inode */ |
543 | int holefit; /* found hole it will fit in */ | 541 | int holefit; /* found hole it will fit in */ |
544 | int i; /* entry number */ | 542 | int i; /* entry number */ |
545 | xfs_mount_t *mp; /* filesystem mount point */ | ||
546 | xfs_dir2_data_aoff_t offset; /* data block offset */ | 543 | xfs_dir2_data_aoff_t offset; /* data block offset */ |
547 | xfs_dir2_sf_entry_t *sfep; /* shortform entry */ | 544 | xfs_dir2_sf_entry_t *sfep; /* shortform entry */ |
548 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ | 545 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
@@ -550,7 +547,6 @@ xfs_dir2_sf_addname_pick( | |||
550 | int used; /* data bytes used */ | 547 | int used; /* data bytes used */ |
551 | 548 | ||
552 | dp = args->dp; | 549 | dp = args->dp; |
553 | mp = dp->i_mount; | ||
554 | 550 | ||
555 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; | 551 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
556 | size = dp->d_ops->data_entsize(args->namelen); | 552 | size = dp->d_ops->data_entsize(args->namelen); |
@@ -616,10 +612,8 @@ xfs_dir2_sf_check( | |||
616 | int offset; /* data offset */ | 612 | int offset; /* data offset */ |
617 | xfs_dir2_sf_entry_t *sfep; /* shortform dir entry */ | 613 | xfs_dir2_sf_entry_t *sfep; /* shortform dir entry */ |
618 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ | 614 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
619 | struct xfs_mount *mp; | ||
620 | 615 | ||
621 | dp = args->dp; | 616 | dp = args->dp; |
622 | mp = dp->i_mount; | ||
623 | 617 | ||
624 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; | 618 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
625 | offset = dp->d_ops->data_first_offset; | 619 | offset = dp->d_ops->data_first_offset; |
@@ -1016,12 +1010,10 @@ xfs_dir2_sf_toino4( | |||
1016 | int oldsize; /* old inode size */ | 1010 | int oldsize; /* old inode size */ |
1017 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ | 1011 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ |
1018 | xfs_dir2_sf_hdr_t *sfp; /* new sf directory */ | 1012 | xfs_dir2_sf_hdr_t *sfp; /* new sf directory */ |
1019 | struct xfs_mount *mp; | ||
1020 | 1013 | ||
1021 | trace_xfs_dir2_sf_toino4(args); | 1014 | trace_xfs_dir2_sf_toino4(args); |
1022 | 1015 | ||
1023 | dp = args->dp; | 1016 | dp = args->dp; |
1024 | mp = dp->i_mount; | ||
1025 | 1017 | ||
1026 | /* | 1018 | /* |
1027 | * Copy the old directory to the buffer. | 1019 | * Copy the old directory to the buffer. |
@@ -1094,12 +1086,10 @@ xfs_dir2_sf_toino8( | |||
1094 | int oldsize; /* old inode size */ | 1086 | int oldsize; /* old inode size */ |
1095 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ | 1087 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ |
1096 | xfs_dir2_sf_hdr_t *sfp; /* new sf directory */ | 1088 | xfs_dir2_sf_hdr_t *sfp; /* new sf directory */ |
1097 | struct xfs_mount *mp; | ||
1098 | 1089 | ||
1099 | trace_xfs_dir2_sf_toino8(args); | 1090 | trace_xfs_dir2_sf_toino8(args); |
1100 | 1091 | ||
1101 | dp = args->dp; | 1092 | dp = args->dp; |
1102 | mp = dp->i_mount; | ||
1103 | 1093 | ||
1104 | /* | 1094 | /* |
1105 | * Copy the old directory to the buffer. | 1095 | * Copy the old directory to the buffer. |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 2ffb80267e37..c0b17ec70c99 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2485,9 +2485,7 @@ xfs_remove( | |||
2485 | xfs_fsblock_t first_block; | 2485 | xfs_fsblock_t first_block; |
2486 | int cancel_flags; | 2486 | int cancel_flags; |
2487 | int committed; | 2487 | int committed; |
2488 | int link_zero; | ||
2489 | uint resblks; | 2488 | uint resblks; |
2490 | uint log_count; | ||
2491 | 2489 | ||
2492 | trace_xfs_remove(dp, name); | 2490 | trace_xfs_remove(dp, name); |
2493 | 2491 | ||
@@ -2502,13 +2500,10 @@ xfs_remove( | |||
2502 | if (error) | 2500 | if (error) |
2503 | goto std_return; | 2501 | goto std_return; |
2504 | 2502 | ||
2505 | if (is_dir) { | 2503 | if (is_dir) |
2506 | tp = xfs_trans_alloc(mp, XFS_TRANS_RMDIR); | 2504 | tp = xfs_trans_alloc(mp, XFS_TRANS_RMDIR); |
2507 | log_count = XFS_DEFAULT_LOG_COUNT; | 2505 | else |
2508 | } else { | ||
2509 | tp = xfs_trans_alloc(mp, XFS_TRANS_REMOVE); | 2506 | tp = xfs_trans_alloc(mp, XFS_TRANS_REMOVE); |
2510 | log_count = XFS_REMOVE_LOG_COUNT; | ||
2511 | } | ||
2512 | cancel_flags = XFS_TRANS_RELEASE_LOG_RES; | 2507 | cancel_flags = XFS_TRANS_RELEASE_LOG_RES; |
2513 | 2508 | ||
2514 | /* | 2509 | /* |
@@ -2576,9 +2571,6 @@ xfs_remove( | |||
2576 | if (error) | 2571 | if (error) |
2577 | goto out_trans_cancel; | 2572 | goto out_trans_cancel; |
2578 | 2573 | ||
2579 | /* Determine if this is the last link while the inode is locked */ | ||
2580 | link_zero = (ip->i_d.di_nlink == 0); | ||
2581 | |||
2582 | xfs_bmap_init(&free_list, &first_block); | 2574 | xfs_bmap_init(&free_list, &first_block); |
2583 | error = xfs_dir_removename(tp, dp, name, ip->i_ino, | 2575 | error = xfs_dir_removename(tp, dp, name, ip->i_ino, |
2584 | &first_block, &free_list, resblks); | 2576 | &first_block, &free_list, resblks); |
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 3fad07136c5d..08e38b96e03e 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -263,7 +263,6 @@ xfs_iomap_eof_want_preallocate( | |||
263 | { | 263 | { |
264 | xfs_fileoff_t start_fsb; | 264 | xfs_fileoff_t start_fsb; |
265 | xfs_filblks_t count_fsb; | 265 | xfs_filblks_t count_fsb; |
266 | xfs_fsblock_t firstblock; | ||
267 | int n, error, imaps; | 266 | int n, error, imaps; |
268 | int found_delalloc = 0; | 267 | int found_delalloc = 0; |
269 | 268 | ||
@@ -288,7 +287,6 @@ xfs_iomap_eof_want_preallocate( | |||
288 | count_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); | 287 | count_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); |
289 | while (count_fsb > 0) { | 288 | while (count_fsb > 0) { |
290 | imaps = nimaps; | 289 | imaps = nimaps; |
291 | firstblock = NULLFSBLOCK; | ||
292 | error = xfs_bmapi_read(ip, start_fsb, count_fsb, imap, &imaps, | 290 | error = xfs_bmapi_read(ip, start_fsb, count_fsb, imap, &imaps, |
293 | 0); | 291 | 0); |
294 | if (error) | 292 | if (error) |
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index f1deb961a296..61abca96ca73 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -349,7 +349,6 @@ xfs_bulkstat( | |||
349 | int *done) /* 1 if there are more stats to get */ | 349 | int *done) /* 1 if there are more stats to get */ |
350 | { | 350 | { |
351 | xfs_buf_t *agbp; /* agi header buffer */ | 351 | xfs_buf_t *agbp; /* agi header buffer */ |
352 | xfs_agi_t *agi; /* agi header data */ | ||
353 | xfs_agino_t agino; /* inode # in allocation group */ | 352 | xfs_agino_t agino; /* inode # in allocation group */ |
354 | xfs_agnumber_t agno; /* allocation group number */ | 353 | xfs_agnumber_t agno; /* allocation group number */ |
355 | xfs_btree_cur_t *cur; /* btree cursor for ialloc btree */ | 354 | xfs_btree_cur_t *cur; /* btree cursor for ialloc btree */ |
@@ -408,7 +407,6 @@ xfs_bulkstat( | |||
408 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); | 407 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); |
409 | if (error) | 408 | if (error) |
410 | break; | 409 | break; |
411 | agi = XFS_BUF_TO_AGI(agbp); | ||
412 | /* | 410 | /* |
413 | * Allocate and initialize a btree cursor for ialloc btree. | 411 | * Allocate and initialize a btree cursor for ialloc btree. |
414 | */ | 412 | */ |