diff options
author | Dave Chinner <david@fromorbit.com> | 2014-06-10 07:32:56 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-10 07:32:56 +1000 |
commit | 7691283d0561a350b7517be94818669fb5e3d910 (patch) | |
tree | 3b939ee86e763c22c6ead988bf62de58e1981915 /fs/xfs/xfs_alloc.c | |
parent | 8612c7e594808e4a67bc2d4661f5925df2be3f51 (diff) | |
parent | 30265117ee1e23fa91920f337a3ea91207f700dc (diff) | |
download | lwn-7691283d0561a350b7517be94818669fb5e3d910.tar.gz lwn-7691283d0561a350b7517be94818669fb5e3d910.zip |
Merge branch 'xfs-misc-fixes-3-for-3.16' into for-next
Diffstat (limited to 'fs/xfs/xfs_alloc.c')
-rw-r--r-- | fs/xfs/xfs_alloc.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index c1cf6a336a72..d43813267a80 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c @@ -257,16 +257,14 @@ xfs_alloc_fix_len( k = rlen % args->prod; if (k == args->mod) return; - if (k > args->mod) { - if ((int)(rlen = rlen - k - args->mod) < (int)args->minlen) - return; - } else { - if ((int)(rlen = rlen - args->prod - (args->mod - k)) < - (int)args->minlen) - return; - } - ASSERT(rlen >= args->minlen); - ASSERT(rlen <= args->maxlen); + if (k > args->mod) + rlen = rlen - (k - args->mod); + else + rlen = rlen - args->prod + (args->mod - k); + if ((int)rlen < (int)args->minlen) + return; + ASSERT(rlen >= args->minlen && rlen <= args->maxlen); + ASSERT(rlen % args->prod == args->mod); args->len = rlen; } @@ -541,7 +539,6 @@ xfs_alloc_read_agfl( XFS_FSS_TO_BB(mp, 1), 0, &bp, &xfs_agfl_buf_ops); if (error) return error; - ASSERT(!xfs_buf_geterror(bp)); xfs_buf_set_ref(bp, XFS_AGFL_REF); *bpp = bp; return 0; |