aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 1c372f998c15..92fedfcc879a 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -256,6 +256,22 @@ xfs_mount_validate_sb(
256 return XFS_ERROR(ENOSYS); 256 return XFS_ERROR(ENOSYS);
257 } 257 }
258 258
259 /*
260 * Currently only very few inode sizes are supported.
261 */
262 switch (sbp->sb_inodesize) {
263 case 256:
264 case 512:
265 case 1024:
266 case 2048:
267 break;
268 default:
269 xfs_fs_mount_cmn_err(flags,
270 "inode size of %d bytes not supported",
271 sbp->sb_inodesize);
272 return XFS_ERROR(ENOSYS);
273 }
274
259 if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) || 275 if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) ||
260 xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) { 276 xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) {
261 xfs_fs_mount_cmn_err(flags, 277 xfs_fs_mount_cmn_err(flags,
@@ -578,27 +594,6 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp)
578 mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG; 594 mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG;
579 mp->m_blockwmask = mp->m_blockwsize - 1; 595 mp->m_blockwmask = mp->m_blockwsize - 1;
580 596
581 /*
582 * Setup for attributes, in case they get created.
583 * This value is for inodes getting attributes for the first time,
584 * the per-inode value is for old attribute values.
585 */
586 ASSERT(sbp->sb_inodesize >= 256 && sbp->sb_inodesize <= 2048);
587 switch (sbp->sb_inodesize) {
588 case 256:
589 mp->m_attroffset = XFS_LITINO(mp) -
590 XFS_BMDR_SPACE_CALC(MINABTPTRS);
591 break;
592 case 512:
593 case 1024:
594 case 2048:
595 mp->m_attroffset = XFS_BMDR_SPACE_CALC(6 * MINABTPTRS);
596 break;
597 default:
598 ASSERT(0);
599 }
600 ASSERT(mp->m_attroffset < XFS_LITINO(mp));
601
602 mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1); 597 mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1);
603 mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0); 598 mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0);
604 mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2; 599 mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2;