aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 2e9b34b7344b..1c0a5a585a82 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -2830,11 +2830,11 @@ xfs_bmap_btalloc(
2830 args.prod = align; 2830 args.prod = align;
2831 if ((args.mod = (xfs_extlen_t)do_mod(ap->off, args.prod))) 2831 if ((args.mod = (xfs_extlen_t)do_mod(ap->off, args.prod)))
2832 args.mod = (xfs_extlen_t)(args.prod - args.mod); 2832 args.mod = (xfs_extlen_t)(args.prod - args.mod);
2833 } else if (mp->m_sb.sb_blocksize >= NBPP) { 2833 } else if (mp->m_sb.sb_blocksize >= PAGE_CACHE_SIZE) {
2834 args.prod = 1; 2834 args.prod = 1;
2835 args.mod = 0; 2835 args.mod = 0;
2836 } else { 2836 } else {
2837 args.prod = NBPP >> mp->m_sb.sb_blocklog; 2837 args.prod = PAGE_CACHE_SIZE >> mp->m_sb.sb_blocklog;
2838 if ((args.mod = (xfs_extlen_t)(do_mod(ap->off, args.prod)))) 2838 if ((args.mod = (xfs_extlen_t)(do_mod(ap->off, args.prod))))
2839 args.mod = (xfs_extlen_t)(args.prod - args.mod); 2839 args.mod = (xfs_extlen_t)(args.prod - args.mod);
2840 } 2840 }
@@ -2969,7 +2969,7 @@ STATIC int
2969xfs_bmap_alloc( 2969xfs_bmap_alloc(
2970 xfs_bmalloca_t *ap) /* bmap alloc argument struct */ 2970 xfs_bmalloca_t *ap) /* bmap alloc argument struct */
2971{ 2971{
2972 if ((ap->ip->i_d.di_flags & XFS_DIFLAG_REALTIME) && ap->userdata) 2972 if (XFS_IS_REALTIME_INODE(ap->ip) && ap->userdata)
2973 return xfs_bmap_rtalloc(ap); 2973 return xfs_bmap_rtalloc(ap);
2974 return xfs_bmap_btalloc(ap); 2974 return xfs_bmap_btalloc(ap);
2975} 2975}
@@ -3096,8 +3096,7 @@ xfs_bmap_del_extent(
3096 /* 3096 /*
3097 * Realtime allocation. Free it and record di_nblocks update. 3097 * Realtime allocation. Free it and record di_nblocks update.
3098 */ 3098 */
3099 if (whichfork == XFS_DATA_FORK && 3099 if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) {
3100 (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
3101 xfs_fsblock_t bno; 3100 xfs_fsblock_t bno;
3102 xfs_filblks_t len; 3101 xfs_filblks_t len;
3103 3102
@@ -3956,7 +3955,6 @@ xfs_bmap_add_attrfork(
3956 xfs_bmap_free_t flist; /* freed extent records */ 3955 xfs_bmap_free_t flist; /* freed extent records */
3957 xfs_mount_t *mp; /* mount structure */ 3956 xfs_mount_t *mp; /* mount structure */
3958 xfs_trans_t *tp; /* transaction pointer */ 3957 xfs_trans_t *tp; /* transaction pointer */
3959 unsigned long s; /* spinlock spl value */
3960 int blks; /* space reservation */ 3958 int blks; /* space reservation */
3961 int version = 1; /* superblock attr version */ 3959 int version = 1; /* superblock attr version */
3962 int committed; /* xaction was committed */ 3960 int committed; /* xaction was committed */
@@ -4053,7 +4051,7 @@ xfs_bmap_add_attrfork(
4053 (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2)) { 4051 (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2)) {
4054 __int64_t sbfields = 0; 4052 __int64_t sbfields = 0;
4055 4053
4056 s = XFS_SB_LOCK(mp); 4054 spin_lock(&mp->m_sb_lock);
4057 if (!XFS_SB_VERSION_HASATTR(&mp->m_sb)) { 4055 if (!XFS_SB_VERSION_HASATTR(&mp->m_sb)) {
4058 XFS_SB_VERSION_ADDATTR(&mp->m_sb); 4056 XFS_SB_VERSION_ADDATTR(&mp->m_sb);
4059 sbfields |= XFS_SB_VERSIONNUM; 4057 sbfields |= XFS_SB_VERSIONNUM;
@@ -4063,10 +4061,10 @@ xfs_bmap_add_attrfork(
4063 sbfields |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2); 4061 sbfields |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);
4064 } 4062 }
4065 if (sbfields) { 4063 if (sbfields) {
4066 XFS_SB_UNLOCK(mp, s); 4064 spin_unlock(&mp->m_sb_lock);
4067 xfs_mod_sb(tp, sbfields); 4065 xfs_mod_sb(tp, sbfields);
4068 } else 4066 } else
4069 XFS_SB_UNLOCK(mp, s); 4067 spin_unlock(&mp->m_sb_lock);
4070 } 4068 }
4071 if ((error = xfs_bmap_finish(&tp, &flist, &committed))) 4069 if ((error = xfs_bmap_finish(&tp, &flist, &committed)))
4072 goto error2; 4070 goto error2;
@@ -6394,7 +6392,7 @@ xfs_bmap_count_blocks(
6394 * Recursively walks each level of a btree 6392 * Recursively walks each level of a btree
6395 * to count total fsblocks is use. 6393 * to count total fsblocks is use.
6396 */ 6394 */
6397int /* error */ 6395STATIC int /* error */
6398xfs_bmap_count_tree( 6396xfs_bmap_count_tree(
6399 xfs_mount_t *mp, /* file system mount point */ 6397 xfs_mount_t *mp, /* file system mount point */
6400 xfs_trans_t *tp, /* transaction pointer */ 6398 xfs_trans_t *tp, /* transaction pointer */
@@ -6470,7 +6468,7 @@ xfs_bmap_count_tree(
6470/* 6468/*
6471 * Count leaf blocks given a range of extent records. 6469 * Count leaf blocks given a range of extent records.
6472 */ 6470 */
6473int 6471STATIC int
6474xfs_bmap_count_leaves( 6472xfs_bmap_count_leaves(
6475 xfs_ifork_t *ifp, 6473 xfs_ifork_t *ifp,
6476 xfs_extnum_t idx, 6474 xfs_extnum_t idx,
@@ -6490,7 +6488,7 @@ xfs_bmap_count_leaves(
6490 * Count leaf blocks given a range of extent records originally 6488 * Count leaf blocks given a range of extent records originally
6491 * in btree format. 6489 * in btree format.
6492 */ 6490 */
6493int 6491STATIC int
6494xfs_bmap_disk_count_leaves( 6492xfs_bmap_disk_count_leaves(
6495 xfs_extnum_t idx, 6493 xfs_extnum_t idx,
6496 xfs_bmbt_block_t *block, 6494 xfs_bmbt_block_t *block,