aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-08-13 02:49:32 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-08-13 02:49:32 -0400
commit4249023a5d14f28d4e68ba15d24d25c0e5be71a6 (patch)
tree30d3d7992dc05879835bf96a5d7a6ab437d5a54b /fs/xfs
parent77508ec8e6ed72c9ba8ca74248a7aabd664e3f57 (diff)
[XFS] cleanup xfs_mountfs
Remove all the useless flags and code keyed off it in xfs_mountfs. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31831a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c2
-rw-r--r--fs/xfs/quota/xfs_qm.c6
-rw-r--r--fs/xfs/quota/xfs_qm.h2
-rw-r--r--fs/xfs/quota/xfs_qm_bhv.c7
-rw-r--r--fs/xfs/xfs_log.c4
-rw-r--r--fs/xfs/xfs_log.h2
-rw-r--r--fs/xfs/xfs_log_priv.h2
-rw-r--r--fs/xfs/xfs_log_recover.c7
-rw-r--r--fs/xfs/xfs_mount.c30
-rw-r--r--fs/xfs/xfs_mount.h15
10 files changed, 27 insertions, 50 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 9ccbb1ca277b..8fdb79046a60 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1722,7 +1722,7 @@ xfs_fs_fill_super(
1722 if (error) 1722 if (error)
1723 goto out_free_sb; 1723 goto out_free_sb;
1724 1724
1725 error = xfs_mountfs(mp, flags); 1725 error = xfs_mountfs(mp);
1726 if (error) 1726 if (error)
1727 goto out_filestream_unmount; 1727 goto out_filestream_unmount;
1728 1728
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 3825d7484079..df0ffef9775a 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -310,8 +310,7 @@ xfs_qm_unmount_quotadestroy(
310 */ 310 */
311void 311void
312xfs_qm_mount_quotas( 312xfs_qm_mount_quotas(
313 xfs_mount_t *mp, 313 xfs_mount_t *mp)
314 int mfsi_flags)
315{ 314{
316 int error = 0; 315 int error = 0;
317 uint sbf; 316 uint sbf;
@@ -346,8 +345,7 @@ xfs_qm_mount_quotas(
346 /* 345 /*
347 * If any of the quotas are not consistent, do a quotacheck. 346 * If any of the quotas are not consistent, do a quotacheck.
348 */ 347 */
349 if (XFS_QM_NEED_QUOTACHECK(mp) && 348 if (XFS_QM_NEED_QUOTACHECK(mp)) {
350 !(mfsi_flags & XFS_MFSI_NO_QUOTACHECK)) {
351 error = xfs_qm_quotacheck(mp); 349 error = xfs_qm_quotacheck(mp);
352 if (error) { 350 if (error) {
353 /* Quotacheck failed and disabled quotas. */ 351 /* Quotacheck failed and disabled quotas. */
diff --git a/fs/xfs/quota/xfs_qm.h b/fs/xfs/quota/xfs_qm.h
index cd2300e374af..44f25349e478 100644
--- a/fs/xfs/quota/xfs_qm.h
+++ b/fs/xfs/quota/xfs_qm.h
@@ -165,7 +165,7 @@ typedef struct xfs_dquot_acct {
165#define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--) 165#define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--)
166 166
167extern void xfs_qm_destroy_quotainfo(xfs_mount_t *); 167extern void xfs_qm_destroy_quotainfo(xfs_mount_t *);
168extern void xfs_qm_mount_quotas(xfs_mount_t *, int); 168extern void xfs_qm_mount_quotas(xfs_mount_t *);
169extern int xfs_qm_quotacheck(xfs_mount_t *); 169extern int xfs_qm_quotacheck(xfs_mount_t *);
170extern void xfs_qm_unmount_quotadestroy(xfs_mount_t *); 170extern void xfs_qm_unmount_quotadestroy(xfs_mount_t *);
171extern int xfs_qm_unmount_quotas(xfs_mount_t *); 171extern int xfs_qm_unmount_quotas(xfs_mount_t *);
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c
index f4f6c4c861d7..eea2e60b456b 100644
--- a/fs/xfs/quota/xfs_qm_bhv.c
+++ b/fs/xfs/quota/xfs_qm_bhv.c
@@ -162,7 +162,7 @@ xfs_qm_newmount(
162 * mounting, and get on with the boring life 162 * mounting, and get on with the boring life
163 * without disk quotas. 163 * without disk quotas.
164 */ 164 */
165 xfs_qm_mount_quotas(mp, 0); 165 xfs_qm_mount_quotas(mp);
166 } else { 166 } else {
167 /* 167 /*
168 * Clear the quota flags, but remember them. This 168 * Clear the quota flags, but remember them. This
@@ -184,13 +184,12 @@ STATIC int
184xfs_qm_endmount( 184xfs_qm_endmount(
185 xfs_mount_t *mp, 185 xfs_mount_t *mp,
186 uint needquotamount, 186 uint needquotamount,
187 uint quotaflags, 187 uint quotaflags)
188 int mfsi_flags)
189{ 188{
190 if (needquotamount) { 189 if (needquotamount) {
191 ASSERT(mp->m_qflags == 0); 190 ASSERT(mp->m_qflags == 0);
192 mp->m_qflags = quotaflags; 191 mp->m_qflags = quotaflags;
193 xfs_qm_mount_quotas(mp, mfsi_flags); 192 xfs_qm_mount_quotas(mp);
194 } 193 }
195 194
196#if defined(DEBUG) && defined(XFS_LOUD_RECOVERY) 195#if defined(DEBUG) && defined(XFS_LOUD_RECOVERY)
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 0816c5d6d76b..9c23864d4fd0 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -588,12 +588,12 @@ error:
588 * mp - ubiquitous xfs mount point structure 588 * mp - ubiquitous xfs mount point structure
589 */ 589 */
590int 590int
591xfs_log_mount_finish(xfs_mount_t *mp, int mfsi_flags) 591xfs_log_mount_finish(xfs_mount_t *mp)
592{ 592{
593 int error; 593 int error;
594 594
595 if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) 595 if (!(mp->m_flags & XFS_MOUNT_NORECOVERY))
596 error = xlog_recover_finish(mp->m_log, mfsi_flags); 596 error = xlog_recover_finish(mp->m_log);
597 else { 597 else {
598 error = 0; 598 error = 0;
599 ASSERT(mp->m_flags & XFS_MOUNT_RDONLY); 599 ASSERT(mp->m_flags & XFS_MOUNT_RDONLY);
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index d1d678ecb63e..d47b91f10822 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -149,7 +149,7 @@ int xfs_log_mount(struct xfs_mount *mp,
149 struct xfs_buftarg *log_target, 149 struct xfs_buftarg *log_target,
150 xfs_daddr_t start_block, 150 xfs_daddr_t start_block,
151 int num_bblocks); 151 int num_bblocks);
152int xfs_log_mount_finish(struct xfs_mount *mp, int); 152int xfs_log_mount_finish(struct xfs_mount *mp);
153void xfs_log_move_tail(struct xfs_mount *mp, 153void xfs_log_move_tail(struct xfs_mount *mp,
154 xfs_lsn_t tail_lsn); 154 xfs_lsn_t tail_lsn);
155int xfs_log_notify(struct xfs_mount *mp, 155int xfs_log_notify(struct xfs_mount *mp,
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index 7dcf11e0b2f0..c8a5b22ee3e3 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -468,7 +468,7 @@ extern int xlog_find_tail(xlog_t *log,
468 xfs_daddr_t *head_blk, 468 xfs_daddr_t *head_blk,
469 xfs_daddr_t *tail_blk); 469 xfs_daddr_t *tail_blk);
470extern int xlog_recover(xlog_t *log); 470extern int xlog_recover(xlog_t *log);
471extern int xlog_recover_finish(xlog_t *log, int mfsi_flags); 471extern int xlog_recover_finish(xlog_t *log);
472extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); 472extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int);
473extern void xlog_recover_process_iunlinks(xlog_t *log); 473extern void xlog_recover_process_iunlinks(xlog_t *log);
474 474
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 9eb722ec744e..82d46ce69d5f 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3940,8 +3940,7 @@ xlog_recover(
3940 */ 3940 */
3941int 3941int
3942xlog_recover_finish( 3942xlog_recover_finish(
3943 xlog_t *log, 3943 xlog_t *log)
3944 int mfsi_flags)
3945{ 3944{
3946 /* 3945 /*
3947 * Now we're ready to do the transactions needed for the 3946 * Now we're ready to do the transactions needed for the
@@ -3969,9 +3968,7 @@ xlog_recover_finish(
3969 xfs_log_force(log->l_mp, (xfs_lsn_t)0, 3968 xfs_log_force(log->l_mp, (xfs_lsn_t)0,
3970 (XFS_LOG_FORCE | XFS_LOG_SYNC)); 3969 (XFS_LOG_FORCE | XFS_LOG_SYNC));
3971 3970
3972 if ( (mfsi_flags & XFS_MFSI_NOUNLINK) == 0 ) { 3971 xlog_recover_process_iunlinks(log);
3973 xlog_recover_process_iunlinks(log);
3974 }
3975 3972
3976 xlog_recover_check_summary(log); 3973 xlog_recover_check_summary(log);
3977 3974
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 73f0ba1ec197..06f0a73bc93f 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -697,11 +697,11 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount)
697 * Update alignment values based on mount options and sb values 697 * Update alignment values based on mount options and sb values
698 */ 698 */
699STATIC int 699STATIC int
700xfs_update_alignment(xfs_mount_t *mp, int mfsi_flags, __uint64_t *update_flags) 700xfs_update_alignment(xfs_mount_t *mp, __uint64_t *update_flags)
701{ 701{
702 xfs_sb_t *sbp = &(mp->m_sb); 702 xfs_sb_t *sbp = &(mp->m_sb);
703 703
704 if (mp->m_dalign && !(mfsi_flags & XFS_MFSI_SECOND)) { 704 if (mp->m_dalign) {
705 /* 705 /*
706 * If stripe unit and stripe width are not multiples 706 * If stripe unit and stripe width are not multiples
707 * of the fs blocksize turn off alignment. 707 * of the fs blocksize turn off alignment.
@@ -857,7 +857,7 @@ xfs_set_inoalignment(xfs_mount_t *mp)
857 * Check that the data (and log if separate) are an ok size. 857 * Check that the data (and log if separate) are an ok size.
858 */ 858 */
859STATIC int 859STATIC int
860xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags) 860xfs_check_sizes(xfs_mount_t *mp)
861{ 861{
862 xfs_buf_t *bp; 862 xfs_buf_t *bp;
863 xfs_daddr_t d; 863 xfs_daddr_t d;
@@ -880,8 +880,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags)
880 return error; 880 return error;
881 } 881 }
882 882
883 if (((mfsi_flags & XFS_MFSI_CLIENT) == 0) && 883 if (mp->m_logdev_targp != mp->m_ddev_targp) {
884 mp->m_logdev_targp != mp->m_ddev_targp) {
885 d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); 884 d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
886 if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { 885 if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) {
887 cmn_err(CE_WARN, "XFS: size check 3 failed"); 886 cmn_err(CE_WARN, "XFS: size check 3 failed");
@@ -916,8 +915,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags)
916 */ 915 */
917int 916int
918xfs_mountfs( 917xfs_mountfs(
919 xfs_mount_t *mp, 918 xfs_mount_t *mp)
920 int mfsi_flags)
921{ 919{
922 xfs_sb_t *sbp = &(mp->m_sb); 920 xfs_sb_t *sbp = &(mp->m_sb);
923 xfs_inode_t *rip; 921 xfs_inode_t *rip;
@@ -978,7 +976,7 @@ xfs_mountfs(
978 * allocator alignment is within an ag, therefore ag has 976 * allocator alignment is within an ag, therefore ag has
979 * to be aligned at stripe boundary. 977 * to be aligned at stripe boundary.
980 */ 978 */
981 error = xfs_update_alignment(mp, mfsi_flags, &update_flags); 979 error = xfs_update_alignment(mp, &update_flags);
982 if (error) 980 if (error)
983 goto error1; 981 goto error1;
984 982
@@ -997,8 +995,7 @@ xfs_mountfs(
997 * since a single partition filesystem is identical to a single 995 * since a single partition filesystem is identical to a single
998 * partition volume/filesystem. 996 * partition volume/filesystem.
999 */ 997 */
1000 if ((mfsi_flags & XFS_MFSI_SECOND) == 0 && 998 if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) {
1001 (mp->m_flags & XFS_MOUNT_NOUUID) == 0) {
1002 if (xfs_uuid_mount(mp)) { 999 if (xfs_uuid_mount(mp)) {
1003 error = XFS_ERROR(EINVAL); 1000 error = XFS_ERROR(EINVAL);
1004 goto error1; 1001 goto error1;
@@ -1026,7 +1023,7 @@ xfs_mountfs(
1026 /* 1023 /*
1027 * Check that the data (and log if separate) are an ok size. 1024 * Check that the data (and log if separate) are an ok size.
1028 */ 1025 */
1029 error = xfs_check_sizes(mp, mfsi_flags); 1026 error = xfs_check_sizes(mp);
1030 if (error) 1027 if (error)
1031 goto error1; 1028 goto error1;
1032 1029
@@ -1040,13 +1037,6 @@ xfs_mountfs(
1040 } 1037 }
1041 1038
1042 /* 1039 /*
1043 * For client case we are done now
1044 */
1045 if (mfsi_flags & XFS_MFSI_CLIENT) {
1046 return 0;
1047 }
1048
1049 /*
1050 * Copies the low order bits of the timestamp and the randomly 1040 * Copies the low order bits of the timestamp and the randomly
1051 * set "sequence" number out of a UUID. 1041 * set "sequence" number out of a UUID.
1052 */ 1042 */
@@ -1183,7 +1173,7 @@ xfs_mountfs(
1183 * delayed until after the root and real-time bitmap inodes 1173 * delayed until after the root and real-time bitmap inodes
1184 * were consistently read in. 1174 * were consistently read in.
1185 */ 1175 */
1186 error = xfs_log_mount_finish(mp, mfsi_flags); 1176 error = xfs_log_mount_finish(mp);
1187 if (error) { 1177 if (error) {
1188 cmn_err(CE_WARN, "XFS: log mount finish failed"); 1178 cmn_err(CE_WARN, "XFS: log mount finish failed");
1189 goto error4; 1179 goto error4;
@@ -1192,7 +1182,7 @@ xfs_mountfs(
1192 /* 1182 /*
1193 * Complete the quota initialisation, post-log-replay component. 1183 * Complete the quota initialisation, post-log-replay component.
1194 */ 1184 */
1195 error = XFS_QM_MOUNT(mp, quotamount, quotaflags, mfsi_flags); 1185 error = XFS_QM_MOUNT(mp, quotamount, quotaflags);
1196 if (error) 1186 if (error)
1197 goto error4; 1187 goto error4;
1198 1188
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 5269bd6e3df0..02c16b9ce2ab 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -114,7 +114,7 @@ struct xfs_dqtrxops;
114struct xfs_quotainfo; 114struct xfs_quotainfo;
115 115
116typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *); 116typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *);
117typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint, int); 117typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint);
118typedef int (*xfs_qmunmount_t)(struct xfs_mount *); 118typedef int (*xfs_qmunmount_t)(struct xfs_mount *);
119typedef void (*xfs_qmdone_t)(struct xfs_mount *); 119typedef void (*xfs_qmdone_t)(struct xfs_mount *);
120typedef void (*xfs_dqrele_t)(struct xfs_dquot *); 120typedef void (*xfs_dqrele_t)(struct xfs_dquot *);
@@ -158,8 +158,8 @@ typedef struct xfs_qmops {
158 158
159#define XFS_QM_INIT(mp, mnt, fl) \ 159#define XFS_QM_INIT(mp, mnt, fl) \
160 (*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl) 160 (*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl)
161#define XFS_QM_MOUNT(mp, mnt, fl, mfsi_flags) \ 161#define XFS_QM_MOUNT(mp, mnt, fl) \
162 (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl, mfsi_flags) 162 (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl)
163#define XFS_QM_UNMOUNT(mp) \ 163#define XFS_QM_UNMOUNT(mp) \
164 (*(mp)->m_qm_ops->xfs_qmunmount)(mp) 164 (*(mp)->m_qm_ops->xfs_qmunmount)(mp)
165#define XFS_QM_DONE(mp) \ 165#define XFS_QM_DONE(mp) \
@@ -442,13 +442,6 @@ void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
442/* 442/*
443 * Flags for xfs_mountfs 443 * Flags for xfs_mountfs
444 */ 444 */
445#define XFS_MFSI_SECOND 0x01 /* Secondary mount -- skip stuff */
446#define XFS_MFSI_CLIENT 0x02 /* Is a client -- skip lots of stuff */
447/* XFS_MFSI_RRINODES */
448#define XFS_MFSI_NOUNLINK 0x08 /* Skip unlinked inode processing in */
449 /* log recovery */
450#define XFS_MFSI_NO_QUOTACHECK 0x10 /* Skip quotacheck processing */
451/* XFS_MFSI_CONVERT_SUNIT */
452#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */ 445#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */
453 446
454#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) 447#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
@@ -517,7 +510,7 @@ typedef struct xfs_mod_sb {
517 510
518extern void xfs_mod_sb(xfs_trans_t *, __int64_t); 511extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
519extern int xfs_log_sbcount(xfs_mount_t *, uint); 512extern int xfs_log_sbcount(xfs_mount_t *, uint);
520extern int xfs_mountfs(xfs_mount_t *mp, int); 513extern int xfs_mountfs(xfs_mount_t *mp);
521extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); 514extern void xfs_mountfs_check_barriers(xfs_mount_t *mp);
522 515
523extern int xfs_unmountfs(xfs_mount_t *); 516extern int xfs_unmountfs(xfs_mount_t *);