X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fxfs%2Fxfs_rtalloc.c;h=5a0b678956e0e3ca616efb76ffb9d827f6d159fa;hb=20f99dcf417a28089ef6c877ae97f5dec2eab435;hp=06fc061c50fc99d1b6ef71685e53bd334aa76281;hpb=7211bb9b64f17b23834d91fc3d0c1d78671ee9a8;p=powerpc.git diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 06fc061c50..5a0b678956 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -24,14 +24,12 @@ #include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_dir.h" #include "xfs_dir2.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" -#include "xfs_dir_sf.h" #include "xfs_dir2_sf.h" #include "xfs_attr_sf.h" #include "xfs_dinode.h" @@ -130,7 +128,8 @@ xfs_growfs_rt_alloc( /* * Lock the inode. */ - if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, &ip))) + if ((error = xfs_trans_iget(mp, tp, ino, 0, + XFS_ILOCK_EXCL, &ip))) goto error_exit; XFS_BMAP_INIT(&flist, &firstblock); /* @@ -140,7 +139,7 @@ xfs_growfs_rt_alloc( cancelflags |= XFS_TRANS_ABORT; error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks, XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock, - resblks, &map, &nmap, &flist); + resblks, &map, &nmap, &flist, NULL); if (!error && nmap < 1) error = XFS_ERROR(ENOSPC); if (error) @@ -170,8 +169,8 @@ xfs_growfs_rt_alloc( /* * Lock the bitmap inode. */ - if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, - &ip))) + if ((error = xfs_trans_iget(mp, tp, ino, 0, + XFS_ILOCK_EXCL, &ip))) goto error_exit; /* * Get a buffer for the block. @@ -1930,7 +1929,7 @@ xfs_growfs_rt( /* * Initial error checking. */ - if (mp->m_rtdev_targp || mp->m_rbmip == NULL || + if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL || (nrblocks = in->newblocks) <= sbp->sb_rblocks || (sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize))) return XFS_ERROR(EINVAL); @@ -2023,8 +2022,8 @@ xfs_growfs_rt( /* * Lock out other callers by grabbing the bitmap inode lock. */ - if ((error = xfs_trans_iget(mp, tp, 0, mp->m_sb.sb_rbmino, - XFS_ILOCK_EXCL, &ip))) + if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, + XFS_ILOCK_EXCL, &ip))) goto error_exit; ASSERT(ip == mp->m_rbmip); /* @@ -2037,8 +2036,8 @@ xfs_growfs_rt( /* * Get the summary inode into the transaction. */ - if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, - 0, XFS_ILOCK_EXCL, &ip))) + if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, + XFS_ILOCK_EXCL, &ip))) goto error_exit; ASSERT(ip == mp->m_rsumip); /* @@ -2158,10 +2157,9 @@ xfs_rtallocate_extent( /* * Lock out other callers by grabbing the bitmap inode lock. */ - error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); - if (error) { + if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, + XFS_ILOCK_EXCL, &ip))) return error; - } sumbp = NULL; /* * Allocate by size, or near another block, or exactly at some block. @@ -2221,10 +2219,9 @@ xfs_rtfree_extent( /* * Synchronize by locking the bitmap inode. */ - error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); - if (error) { + if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, + XFS_ILOCK_EXCL, &ip))) return error; - } #if defined(__KERNEL__) && defined(DEBUG) /* * Check to see that this whole range is currently allocated. @@ -2365,8 +2362,8 @@ xfs_rtpick_extent( __uint64_t seq; /* sequence number of file creation */ __uint64_t *seqp; /* pointer to seqno in inode */ - error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); - if (error) + if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, + XFS_ILOCK_EXCL, &ip))) return error; ASSERT(ip == mp->m_rbmip); seqp = (__uint64_t *)&ip->i_d.di_atime; @@ -2405,10 +2402,10 @@ xfs_rtprint_range( { xfs_extlen_t i; /* block number in the extent */ - printk("%Ld: ", (long long)start); + cmn_err(CE_DEBUG, "%Ld: ", (long long)start); for (i = 0; i < len; i++) - printk("%d", xfs_rtcheck_bit(mp, tp, start + i, 1)); - printk("\n"); + cmn_err(CE_DEBUG, "%d", xfs_rtcheck_bit(mp, tp, start + i, 1)); + cmn_err(CE_DEBUG, "\n"); } /* @@ -2432,17 +2429,17 @@ xfs_rtprint_summary( (void)xfs_rtget_summary(mp, tp, l, i, &sumbp, &sb, &c); if (c) { if (!p) { - printk("%Ld-%Ld:", 1LL << l, + cmn_err(CE_DEBUG, "%Ld-%Ld:", 1LL << l, XFS_RTMIN((1LL << l) + ((1LL << l) - 1LL), mp->m_sb.sb_rextents)); p = 1; } - printk(" %Ld:%d", (long long)i, c); + cmn_err(CE_DEBUG, " %Ld:%d", (long long)i, c); } } if (p) - printk("\n"); + cmn_err(CE_DEBUG, "\n"); } if (sumbp) xfs_trans_brelse(tp, sumbp);