aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2007-06-18 02:50:37 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-07-14 01:35:36 -0400
commit957d0ebed04239b734552c7da3fae9094b6f090c (patch)
tree6f5034b22028a03e31771d1a3fa5ad8d59557c09 /fs/xfs/xfs_bmap.c
parent84e1e99f112dead8f9ba036c02d24a9f5ce7f544 (diff)
[XFS] Cleanup inode extent size hint extraction
SGI-PV: 966004 SGI-Modid: xfs-linux-melb:xfs-kern:28866a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 9a654faf0c08..183add2f21b7 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -2609,8 +2609,7 @@ xfs_bmap_rtalloc(
2609 xfs_rtblock_t rtb; 2609 xfs_rtblock_t rtb;
2610 2610
2611 mp = ap->ip->i_mount; 2611 mp = ap->ip->i_mount;
2612 align = ap->ip->i_d.di_extsize ? 2612 align = xfs_get_extsz_hint(ap->ip);
2613 ap->ip->i_d.di_extsize : mp->m_sb.sb_rextsize;
2614 prod = align / mp->m_sb.sb_rextsize; 2613 prod = align / mp->m_sb.sb_rextsize;
2615 error = xfs_bmap_extsize_align(mp, ap->gotp, ap->prevp, 2614 error = xfs_bmap_extsize_align(mp, ap->gotp, ap->prevp,
2616 align, 1, ap->eof, 0, 2615 align, 1, ap->eof, 0,
@@ -2715,9 +2714,7 @@ xfs_bmap_btalloc(
2715 int error; 2714 int error;
2716 2715
2717 mp = ap->ip->i_mount; 2716 mp = ap->ip->i_mount;
2718 align = (ap->userdata && ap->ip->i_d.di_extsize && 2717 align = ap->userdata ? xfs_get_extsz_hint(ap->ip) : 0;
2719 (ap->ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)) ?
2720 ap->ip->i_d.di_extsize : 0;
2721 if (unlikely(align)) { 2718 if (unlikely(align)) {
2722 error = xfs_bmap_extsize_align(mp, ap->gotp, ap->prevp, 2719 error = xfs_bmap_extsize_align(mp, ap->gotp, ap->prevp,
2723 align, 0, ap->eof, 0, ap->conv, 2720 align, 0, ap->eof, 0, ap->conv,
@@ -2817,9 +2814,9 @@ xfs_bmap_btalloc(
2817 args.total = ap->total; 2814 args.total = ap->total;
2818 args.minlen = ap->minlen; 2815 args.minlen = ap->minlen;
2819 } 2816 }
2820 if (unlikely(ap->userdata && ap->ip->i_d.di_extsize && 2817 /* apply extent size hints if obtained earlier */
2821 (ap->ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE))) { 2818 if (unlikely(align)) {
2822 args.prod = ap->ip->i_d.di_extsize; 2819 args.prod = align;
2823 if ((args.mod = (xfs_extlen_t)do_mod(ap->off, args.prod))) 2820 if ((args.mod = (xfs_extlen_t)do_mod(ap->off, args.prod)))
2824 args.mod = (xfs_extlen_t)(args.prod - args.mod); 2821 args.mod = (xfs_extlen_t)(args.prod - args.mod);
2825 } else if (mp->m_sb.sb_blocksize >= NBPP) { 2822 } else if (mp->m_sb.sb_blocksize >= NBPP) {
@@ -4868,12 +4865,7 @@ xfs_bmapi(
4868 xfs_extlen_t extsz; 4865 xfs_extlen_t extsz;
4869 4866
4870 /* Figure out the extent size, adjust alen */ 4867 /* Figure out the extent size, adjust alen */
4871 if (rt) { 4868 extsz = xfs_get_extsz_hint(ip);
4872 if (!(extsz = ip->i_d.di_extsize))
4873 extsz = mp->m_sb.sb_rextsize;
4874 } else {
4875 extsz = ip->i_d.di_extsize;
4876 }
4877 if (extsz) { 4869 if (extsz) {
4878 error = xfs_bmap_extsize_align(mp, 4870 error = xfs_bmap_extsize_align(mp,
4879 &got, &prev, extsz, 4871 &got, &prev, extsz,
@@ -5813,8 +5805,7 @@ xfs_getbmap(
5813 ip->i_d.di_format != XFS_DINODE_FMT_LOCAL) 5805 ip->i_d.di_format != XFS_DINODE_FMT_LOCAL)
5814 return XFS_ERROR(EINVAL); 5806 return XFS_ERROR(EINVAL);
5815 if (whichfork == XFS_DATA_FORK) { 5807 if (whichfork == XFS_DATA_FORK) {
5816 if ((ip->i_d.di_extsize && (ip->i_d.di_flags & 5808 if (xfs_get_extsz_hint(ip) ||
5817 (XFS_DIFLAG_REALTIME|XFS_DIFLAG_EXTSIZE))) ||
5818 ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC|XFS_DIFLAG_APPEND)){ 5809 ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC|XFS_DIFLAG_APPEND)){
5819 prealloced = 1; 5810 prealloced = 1;
5820 fixlen = XFS_MAXIOFFSET(mp); 5811 fixlen = XFS_MAXIOFFSET(mp);