xfs
[Top] [All Lists]

[PATCH 02/18] xfs: pass xfs_mount directly to xfs_ialloc_cluster_alignme

To: xfs@xxxxxxxxxxx
Subject: [PATCH 02/18] xfs: pass xfs_mount directly to xfs_ialloc_cluster_alignment()
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Thu, 24 Jul 2014 10:22:52 -0400
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1406211788-63206-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1406211788-63206-1-git-send-email-bfoster@xxxxxxxxxx>
xfs_ialloc_cluster_alignment() takes an args parameter but only uses the
xfs_mount pointer. Replace the args parameter with mp such that we can
use this function from additional contexts.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
 fs/xfs/libxfs/xfs_ialloc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 6e2ccb3..5448a74 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -48,12 +48,12 @@
  */
 static inline int
 xfs_ialloc_cluster_alignment(
-       xfs_alloc_arg_t *args)
+       struct xfs_mount *mp)
 {
-       if (xfs_sb_version_hasalign(&args->mp->m_sb) &&
-           args->mp->m_sb.sb_inoalignmt >=
-            XFS_B_TO_FSBT(args->mp, args->mp->m_inode_cluster_size))
-               return args->mp->m_sb.sb_inoalignmt;
+       if (xfs_sb_version_hasalign(&mp->m_sb) &&
+           mp->m_sb.sb_inoalignmt >=
+            XFS_B_TO_FSBT(mp, mp->m_inode_cluster_size))
+               return mp->m_sb.sb_inoalignmt;
        return 1;
 }
 
@@ -407,7 +407,7 @@ xfs_ialloc_ag_alloc(
                 * but not to use them in the actual exact allocation.
                 */
                args.alignment = 1;
-               args.minalignslop = xfs_ialloc_cluster_alignment(&args) - 1;
+               args.minalignslop = xfs_ialloc_cluster_alignment(args.mp) - 1;
 
                /* Allow space for the inode btree to split. */
                args.minleft = args.mp->m_in_maxlevels - 1;
@@ -443,7 +443,7 @@ xfs_ialloc_ag_alloc(
                        args.alignment = args.mp->m_dalign;
                        isaligned = 1;
                } else
-                       args.alignment = xfs_ialloc_cluster_alignment(&args);
+                       args.alignment = xfs_ialloc_cluster_alignment(args.mp);
                /*
                 * Need to figure out where to allocate the inode blocks.
                 * Ideally they should be spaced out through the a.g.
@@ -472,7 +472,7 @@ xfs_ialloc_ag_alloc(
                args.type = XFS_ALLOCTYPE_NEAR_BNO;
                args.agbno = be32_to_cpu(agi->agi_root);
                args.fsbno = XFS_AGB_TO_FSB(args.mp, agno, args.agbno);
-               args.alignment = xfs_ialloc_cluster_alignment(&args);
+               args.alignment = xfs_ialloc_cluster_alignment(args.mp);
                if ((error = xfs_alloc_vextent(&args)))
                        return error;
        }
-- 
1.8.3.1

<Prev in Thread] Current Thread [Next in Thread>