aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ialloc.c
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-12-12 23:51:49 -0500
committerDave Chinner <david@fromorbit.com>2013-12-12 23:51:49 -0500
commit6e0c7b8c3ea62d684af267d34fc015253e7cd6e5 (patch)
treeaf75e2ae1734eb7cbf0f79a1e4687f3cabe704e7 /fs/xfs/xfs_ialloc.c
parenta2ba07b2d2215bed560aa67c84275304314d9691 (diff)
xfs: use xfs_icluster_size_fsb in xfs_ialloc_inode_init
Use xfs_icluster_size_fsb() in xfs_ialloc_inode_init(), rename variable ninodes to inodes_per_cluster, the latter is more meaningful. Signed-off-by: Jie Liu <jeff.liu@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_ialloc.c')
-rw-r--r--fs/xfs/xfs_ialloc.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index eacc59c7cb80..6ee592cfc0db 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -170,27 +170,20 @@ xfs_ialloc_inode_init(
170{ 170{
171 struct xfs_buf *fbuf; 171 struct xfs_buf *fbuf;
172 struct xfs_dinode *free; 172 struct xfs_dinode *free;
173 int blks_per_cluster, nbufs, ninodes; 173 int nbufs, blks_per_cluster, inodes_per_cluster;
174 int version; 174 int version;
175 int i, j; 175 int i, j;
176 xfs_daddr_t d; 176 xfs_daddr_t d;
177 xfs_ino_t ino = 0; 177 xfs_ino_t ino = 0;
178 178
179 /* 179 /*
180 * Loop over the new block(s), filling in the inodes. 180 * Loop over the new block(s), filling in the inodes. For small block
181 * For small block sizes, manipulate the inodes in buffers 181 * sizes, manipulate the inodes in buffers which are multiples of the
182 * which are multiples of the blocks size. 182 * blocks size.
183 */ 183 */
184 if (mp->m_sb.sb_blocksize >= mp->m_inode_cluster_size) { 184 blks_per_cluster = xfs_icluster_size_fsb(mp);
185 blks_per_cluster = 1; 185 inodes_per_cluster = blks_per_cluster << mp->m_sb.sb_inopblog;
186 nbufs = length; 186 nbufs = length / blks_per_cluster;
187 ninodes = mp->m_sb.sb_inopblock;
188 } else {
189 blks_per_cluster = mp->m_inode_cluster_size /
190 mp->m_sb.sb_blocksize;
191 nbufs = length / blks_per_cluster;
192 ninodes = blks_per_cluster * mp->m_sb.sb_inopblock;
193 }
194 187
195 /* 188 /*
196 * Figure out what version number to use in the inodes we create. If 189 * Figure out what version number to use in the inodes we create. If
@@ -246,7 +239,7 @@ xfs_ialloc_inode_init(
246 /* Initialize the inode buffers and log them appropriately. */ 239 /* Initialize the inode buffers and log them appropriately. */
247 fbuf->b_ops = &xfs_inode_buf_ops; 240 fbuf->b_ops = &xfs_inode_buf_ops;
248 xfs_buf_zero(fbuf, 0, BBTOB(fbuf->b_length)); 241 xfs_buf_zero(fbuf, 0, BBTOB(fbuf->b_length));
249 for (i = 0; i < ninodes; i++) { 242 for (i = 0; i < inodes_per_cluster; i++) {
250 int ioffset = i << mp->m_sb.sb_inodelog; 243 int ioffset = i << mp->m_sb.sb_inodelog;
251 uint isize = xfs_dinode_size(version); 244 uint isize = xfs_dinode_size(version);
252 245