xfs: cleanup duplicate initializations
follow these guidelines: - leave initialization in the declaration block if it fits the line - move to the code where it's more suitable ('for' init block) The last chunk was modified from David's original to be a correct fix for what appeared to be a duplicate initialization. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
parent
8a072a4d4c
commit
45c51b9994
@ -202,7 +202,7 @@ xfs_swap_extents(
|
|||||||
xfs_inode_t *tip, /* tmp inode */
|
xfs_inode_t *tip, /* tmp inode */
|
||||||
xfs_swapext_t *sxp)
|
xfs_swapext_t *sxp)
|
||||||
{
|
{
|
||||||
xfs_mount_t *mp;
|
xfs_mount_t *mp = ip->i_mount;
|
||||||
xfs_trans_t *tp;
|
xfs_trans_t *tp;
|
||||||
xfs_bstat_t *sbp = &sxp->sx_stat;
|
xfs_bstat_t *sbp = &sxp->sx_stat;
|
||||||
xfs_ifork_t *tempifp, *ifp, *tifp;
|
xfs_ifork_t *tempifp, *ifp, *tifp;
|
||||||
@ -212,16 +212,12 @@ xfs_swap_extents(
|
|||||||
int taforkblks = 0;
|
int taforkblks = 0;
|
||||||
__uint64_t tmp;
|
__uint64_t tmp;
|
||||||
|
|
||||||
mp = ip->i_mount;
|
|
||||||
|
|
||||||
tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL);
|
tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL);
|
||||||
if (!tempifp) {
|
if (!tempifp) {
|
||||||
error = XFS_ERROR(ENOMEM);
|
error = XFS_ERROR(ENOMEM);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
sbp = &sxp->sx_stat;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we have to do two separate lock calls here to keep lockdep
|
* we have to do two separate lock calls here to keep lockdep
|
||||||
* happy. If we try to get all the locks in one call, lock will
|
* happy. If we try to get all the locks in one call, lock will
|
||||||
|
@ -970,7 +970,6 @@ xfs_iflush_abort(
|
|||||||
{
|
{
|
||||||
xfs_inode_log_item_t *iip = ip->i_itemp;
|
xfs_inode_log_item_t *iip = ip->i_itemp;
|
||||||
|
|
||||||
iip = ip->i_itemp;
|
|
||||||
if (iip) {
|
if (iip) {
|
||||||
struct xfs_ail *ailp = iip->ili_item.li_ailp;
|
struct xfs_ail *ailp = iip->ili_item.li_ailp;
|
||||||
if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
|
if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
|
||||||
|
@ -1900,7 +1900,7 @@ xfs_mod_incore_sb_batch(
|
|||||||
uint nmsb,
|
uint nmsb,
|
||||||
int rsvd)
|
int rsvd)
|
||||||
{
|
{
|
||||||
xfs_mod_sb_t *msbp = &msb[0];
|
xfs_mod_sb_t *msbp;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1910,7 +1910,7 @@ xfs_mod_incore_sb_batch(
|
|||||||
* changes will be atomic.
|
* changes will be atomic.
|
||||||
*/
|
*/
|
||||||
spin_lock(&mp->m_sb_lock);
|
spin_lock(&mp->m_sb_lock);
|
||||||
for (msbp = &msbp[0]; msbp < (msb + nmsb); msbp++) {
|
for (msbp = msb; msbp < (msb + nmsb); msbp++) {
|
||||||
ASSERT(msbp->msb_field < XFS_SBS_ICOUNT ||
|
ASSERT(msbp->msb_field < XFS_SBS_ICOUNT ||
|
||||||
msbp->msb_field > XFS_SBS_FDBLOCKS);
|
msbp->msb_field > XFS_SBS_FDBLOCKS);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user