aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-05-20 01:10:36 -0400
committerNiv Sardi <xaiki@debian.org>2008-07-28 02:58:26 -0400
commite34b562c6bbffc3c466251ffa1d2adaf163db566 (patch)
treefaf5bd91daf393f390f2512f88984061318af78b /fs/xfs
parent19f354d4c3f4c48bf6b2a86227d8e3050e5f7d50 (diff)
[XFS] add xfs_setup_devices helper
Split setting the block and sector size out of xfs_fs_fill_super into a small helper to make xfs_fs_fill_super more readable. SGI-PV: 981951 SGI-Modid: xfs-linux-melb:xfs-kern:31194a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c58
1 files changed, 35 insertions, 23 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 055faa06ca22..613370f9a4bd 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -861,7 +861,41 @@ xfs_open_devices(
861 return error; 861 return error;
862} 862}
863 863
864/*
865 * Setup xfs_mount buffer target pointers based on superblock
866 */
867STATIC int
868xfs_setup_devices(
869 struct xfs_mount *mp)
870{
871 int error;
864 872
873 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize,
874 mp->m_sb.sb_sectsize);
875 if (error)
876 return error;
877
878 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
879 unsigned int log_sector_size = BBSIZE;
880
881 if (xfs_sb_version_hassector(&mp->m_sb))
882 log_sector_size = mp->m_sb.sb_logsectsize;
883 error = xfs_setsize_buftarg(mp->m_logdev_targp,
884 mp->m_sb.sb_blocksize,
885 log_sector_size);
886 if (error)
887 return error;
888 }
889 if (mp->m_rtdev_targp) {
890 error = xfs_setsize_buftarg(mp->m_rtdev_targp,
891 mp->m_sb.sb_blocksize,
892 mp->m_sb.sb_sectsize);
893 if (error)
894 return error;
895 }
896
897 return 0;
898}
865 899
866/* 900/*
867 * XFS AIL push thread support 901 * XFS AIL push thread support
@@ -1742,31 +1776,9 @@ xfs_fs_fill_super(
1742 if (error) 1776 if (error)
1743 goto error2; 1777 goto error2;
1744 1778
1745 /* 1779 error = xfs_setup_devices(mp);
1746 * Setup xfs_mount buffer target pointers based on superblock
1747 */
1748 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize,
1749 mp->m_sb.sb_sectsize);
1750 if (error) 1780 if (error)
1751 goto error2; 1781 goto error2;
1752 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
1753 unsigned int log_sector_size = BBSIZE;
1754
1755 if (xfs_sb_version_hassector(&mp->m_sb))
1756 log_sector_size = mp->m_sb.sb_logsectsize;
1757 error = xfs_setsize_buftarg(mp->m_logdev_targp,
1758 mp->m_sb.sb_blocksize,
1759 log_sector_size);
1760 if (error)
1761 goto error2;
1762 }
1763 if (mp->m_rtdev_targp) {
1764 error = xfs_setsize_buftarg(mp->m_rtdev_targp,
1765 mp->m_sb.sb_blocksize,
1766 mp->m_sb.sb_sectsize);
1767 if (error)
1768 goto error2;
1769 }
1770 1782
1771 if (mp->m_flags & XFS_MOUNT_BARRIER) 1783 if (mp->m_flags & XFS_MOUNT_BARRIER)
1772 xfs_mountfs_check_barriers(mp); 1784 xfs_mountfs_check_barriers(mp);