Commit 4249023a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Lachlan McIlroy

[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: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent 77508ec8
...@@ -1722,7 +1722,7 @@ xfs_fs_fill_super( ...@@ -1722,7 +1722,7 @@ xfs_fs_fill_super(
if (error) if (error)
goto out_free_sb; goto out_free_sb;
error = xfs_mountfs(mp, flags); error = xfs_mountfs(mp);
if (error) if (error)
goto out_filestream_unmount; goto out_filestream_unmount;
......
...@@ -310,8 +310,7 @@ xfs_qm_unmount_quotadestroy( ...@@ -310,8 +310,7 @@ xfs_qm_unmount_quotadestroy(
*/ */
void void
xfs_qm_mount_quotas( xfs_qm_mount_quotas(
xfs_mount_t *mp, xfs_mount_t *mp)
int mfsi_flags)
{ {
int error = 0; int error = 0;
uint sbf; uint sbf;
...@@ -346,8 +345,7 @@ xfs_qm_mount_quotas( ...@@ -346,8 +345,7 @@ xfs_qm_mount_quotas(
/* /*
* If any of the quotas are not consistent, do a quotacheck. * If any of the quotas are not consistent, do a quotacheck.
*/ */
if (XFS_QM_NEED_QUOTACHECK(mp) && if (XFS_QM_NEED_QUOTACHECK(mp)) {
!(mfsi_flags & XFS_MFSI_NO_QUOTACHECK)) {
error = xfs_qm_quotacheck(mp); error = xfs_qm_quotacheck(mp);
if (error) { if (error) {
/* Quotacheck failed and disabled quotas. */ /* Quotacheck failed and disabled quotas. */
......
...@@ -165,7 +165,7 @@ typedef struct xfs_dquot_acct { ...@@ -165,7 +165,7 @@ typedef struct xfs_dquot_acct {
#define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--) #define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--)
extern void xfs_qm_destroy_quotainfo(xfs_mount_t *); extern void xfs_qm_destroy_quotainfo(xfs_mount_t *);
extern void xfs_qm_mount_quotas(xfs_mount_t *, int); extern void xfs_qm_mount_quotas(xfs_mount_t *);
extern int xfs_qm_quotacheck(xfs_mount_t *); extern int xfs_qm_quotacheck(xfs_mount_t *);
extern void xfs_qm_unmount_quotadestroy(xfs_mount_t *); extern void xfs_qm_unmount_quotadestroy(xfs_mount_t *);
extern int xfs_qm_unmount_quotas(xfs_mount_t *); extern int xfs_qm_unmount_quotas(xfs_mount_t *);
......
...@@ -162,7 +162,7 @@ xfs_qm_newmount( ...@@ -162,7 +162,7 @@ xfs_qm_newmount(
* mounting, and get on with the boring life * mounting, and get on with the boring life
* without disk quotas. * without disk quotas.
*/ */
xfs_qm_mount_quotas(mp, 0); xfs_qm_mount_quotas(mp);
} else { } else {
/* /*
* Clear the quota flags, but remember them. This * Clear the quota flags, but remember them. This
...@@ -184,13 +184,12 @@ STATIC int ...@@ -184,13 +184,12 @@ STATIC int
xfs_qm_endmount( xfs_qm_endmount(
xfs_mount_t *mp, xfs_mount_t *mp,
uint needquotamount, uint needquotamount,
uint quotaflags, uint quotaflags)
int mfsi_flags)
{ {
if (needquotamount) { if (needquotamount) {
ASSERT(mp->m_qflags == 0); ASSERT(mp->m_qflags == 0);
mp->m_qflags = quotaflags; mp->m_qflags = quotaflags;
xfs_qm_mount_quotas(mp, mfsi_flags); xfs_qm_mount_quotas(mp);
} }
#if defined(DEBUG) && defined(XFS_LOUD_RECOVERY) #if defined(DEBUG) && defined(XFS_LOUD_RECOVERY)
......
...@@ -588,12 +588,12 @@ xfs_log_mount( ...@@ -588,12 +588,12 @@ xfs_log_mount(
* mp - ubiquitous xfs mount point structure * mp - ubiquitous xfs mount point structure
*/ */
int int
xfs_log_mount_finish(xfs_mount_t *mp, int mfsi_flags) xfs_log_mount_finish(xfs_mount_t *mp)
{ {
int error; int error;
if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) if (!(mp->m_flags & XFS_MOUNT_NORECOVERY))
error = xlog_recover_finish(mp->m_log, mfsi_flags); error = xlog_recover_finish(mp->m_log);
else { else {
error = 0; error = 0;
ASSERT(mp->m_flags & XFS_MOUNT_RDONLY); ASSERT(mp->m_flags & XFS_MOUNT_RDONLY);
......
...@@ -149,7 +149,7 @@ int xfs_log_mount(struct xfs_mount *mp, ...@@ -149,7 +149,7 @@ int xfs_log_mount(struct xfs_mount *mp,
struct xfs_buftarg *log_target, struct xfs_buftarg *log_target,
xfs_daddr_t start_block, xfs_daddr_t start_block,
int num_bblocks); int num_bblocks);
int xfs_log_mount_finish(struct xfs_mount *mp, int); int xfs_log_mount_finish(struct xfs_mount *mp);
void xfs_log_move_tail(struct xfs_mount *mp, void xfs_log_move_tail(struct xfs_mount *mp,
xfs_lsn_t tail_lsn); xfs_lsn_t tail_lsn);
int xfs_log_notify(struct xfs_mount *mp, int xfs_log_notify(struct xfs_mount *mp,
......
...@@ -468,7 +468,7 @@ extern int xlog_find_tail(xlog_t *log, ...@@ -468,7 +468,7 @@ extern int xlog_find_tail(xlog_t *log,
xfs_daddr_t *head_blk, xfs_daddr_t *head_blk,
xfs_daddr_t *tail_blk); xfs_daddr_t *tail_blk);
extern int xlog_recover(xlog_t *log); extern int xlog_recover(xlog_t *log);
extern int xlog_recover_finish(xlog_t *log, int mfsi_flags); extern int xlog_recover_finish(xlog_t *log);
extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int);
extern void xlog_recover_process_iunlinks(xlog_t *log); extern void xlog_recover_process_iunlinks(xlog_t *log);
......
...@@ -3940,8 +3940,7 @@ xlog_recover( ...@@ -3940,8 +3940,7 @@ xlog_recover(
*/ */
int int
xlog_recover_finish( xlog_recover_finish(
xlog_t *log, xlog_t *log)
int mfsi_flags)
{ {
/* /*
* Now we're ready to do the transactions needed for the * Now we're ready to do the transactions needed for the
...@@ -3969,9 +3968,7 @@ xlog_recover_finish( ...@@ -3969,9 +3968,7 @@ xlog_recover_finish(
xfs_log_force(log->l_mp, (xfs_lsn_t)0, xfs_log_force(log->l_mp, (xfs_lsn_t)0,
(XFS_LOG_FORCE | XFS_LOG_SYNC)); (XFS_LOG_FORCE | XFS_LOG_SYNC));
if ( (mfsi_flags & XFS_MFSI_NOUNLINK) == 0 ) { xlog_recover_process_iunlinks(log);
xlog_recover_process_iunlinks(log);
}
xlog_recover_check_summary(log); xlog_recover_check_summary(log);
......
...@@ -697,11 +697,11 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount) ...@@ -697,11 +697,11 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount)
* Update alignment values based on mount options and sb values * Update alignment values based on mount options and sb values
*/ */
STATIC int STATIC int
xfs_update_alignment(xfs_mount_t *mp, int mfsi_flags, __uint64_t *update_flags) xfs_update_alignment(xfs_mount_t *mp, __uint64_t *update_flags)
{ {
xfs_sb_t *sbp = &(mp->m_sb); xfs_sb_t *sbp = &(mp->m_sb);
if (mp->m_dalign && !(mfsi_flags & XFS_MFSI_SECOND)) { if (mp->m_dalign) {
/* /*
* If stripe unit and stripe width are not multiples * If stripe unit and stripe width are not multiples
* of the fs blocksize turn off alignment. * of the fs blocksize turn off alignment.
...@@ -857,7 +857,7 @@ xfs_set_inoalignment(xfs_mount_t *mp) ...@@ -857,7 +857,7 @@ xfs_set_inoalignment(xfs_mount_t *mp)
* Check that the data (and log if separate) are an ok size. * Check that the data (and log if separate) are an ok size.
*/ */
STATIC int STATIC int
xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags) xfs_check_sizes(xfs_mount_t *mp)
{ {
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_daddr_t d; xfs_daddr_t d;
...@@ -880,8 +880,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags) ...@@ -880,8 +880,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags)
return error; return error;
} }
if (((mfsi_flags & XFS_MFSI_CLIENT) == 0) && if (mp->m_logdev_targp != mp->m_ddev_targp) {
mp->m_logdev_targp != mp->m_ddev_targp) {
d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) {
cmn_err(CE_WARN, "XFS: size check 3 failed"); cmn_err(CE_WARN, "XFS: size check 3 failed");
...@@ -916,8 +915,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags) ...@@ -916,8 +915,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags)
*/ */
int int
xfs_mountfs( xfs_mountfs(
xfs_mount_t *mp, xfs_mount_t *mp)
int mfsi_flags)
{ {
xfs_sb_t *sbp = &(mp->m_sb); xfs_sb_t *sbp = &(mp->m_sb);
xfs_inode_t *rip; xfs_inode_t *rip;
...@@ -978,7 +976,7 @@ xfs_mountfs( ...@@ -978,7 +976,7 @@ xfs_mountfs(
* allocator alignment is within an ag, therefore ag has * allocator alignment is within an ag, therefore ag has
* to be aligned at stripe boundary. * to be aligned at stripe boundary.
*/ */
error = xfs_update_alignment(mp, mfsi_flags, &update_flags); error = xfs_update_alignment(mp, &update_flags);
if (error) if (error)
goto error1; goto error1;
...@@ -997,8 +995,7 @@ xfs_mountfs( ...@@ -997,8 +995,7 @@ xfs_mountfs(
* since a single partition filesystem is identical to a single * since a single partition filesystem is identical to a single
* partition volume/filesystem. * partition volume/filesystem.
*/ */
if ((mfsi_flags & XFS_MFSI_SECOND) == 0 && if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) {
(mp->m_flags & XFS_MOUNT_NOUUID) == 0) {
if (xfs_uuid_mount(mp)) { if (xfs_uuid_mount(mp)) {
error = XFS_ERROR(EINVAL); error = XFS_ERROR(EINVAL);
goto error1; goto error1;
...@@ -1026,7 +1023,7 @@ xfs_mountfs( ...@@ -1026,7 +1023,7 @@ xfs_mountfs(
/* /*
* Check that the data (and log if separate) are an ok size. * Check that the data (and log if separate) are an ok size.
*/ */
error = xfs_check_sizes(mp, mfsi_flags); error = xfs_check_sizes(mp);
if (error) if (error)
goto error1; goto error1;
...@@ -1039,13 +1036,6 @@ xfs_mountfs( ...@@ -1039,13 +1036,6 @@ xfs_mountfs(
goto error1; goto error1;
} }
/*
* For client case we are done now
*/
if (mfsi_flags & XFS_MFSI_CLIENT) {
return 0;
}
/* /*
* Copies the low order bits of the timestamp and the randomly * Copies the low order bits of the timestamp and the randomly
* set "sequence" number out of a UUID. * set "sequence" number out of a UUID.
...@@ -1183,7 +1173,7 @@ xfs_mountfs( ...@@ -1183,7 +1173,7 @@ xfs_mountfs(
* delayed until after the root and real-time bitmap inodes * delayed until after the root and real-time bitmap inodes
* were consistently read in. * were consistently read in.
*/ */
error = xfs_log_mount_finish(mp, mfsi_flags); error = xfs_log_mount_finish(mp);
if (error) { if (error) {
cmn_err(CE_WARN, "XFS: log mount finish failed"); cmn_err(CE_WARN, "XFS: log mount finish failed");
goto error4; goto error4;
...@@ -1192,7 +1182,7 @@ xfs_mountfs( ...@@ -1192,7 +1182,7 @@ xfs_mountfs(
/* /*
* Complete the quota initialisation, post-log-replay component. * Complete the quota initialisation, post-log-replay component.
*/ */
error = XFS_QM_MOUNT(mp, quotamount, quotaflags, mfsi_flags); error = XFS_QM_MOUNT(mp, quotamount, quotaflags);
if (error) if (error)
goto error4; goto error4;
......
...@@ -114,7 +114,7 @@ struct xfs_dqtrxops; ...@@ -114,7 +114,7 @@ struct xfs_dqtrxops;
struct xfs_quotainfo; struct xfs_quotainfo;
typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *); typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *);
typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint, int); typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint);
typedef int (*xfs_qmunmount_t)(struct xfs_mount *); typedef int (*xfs_qmunmount_t)(struct xfs_mount *);
typedef void (*xfs_qmdone_t)(struct xfs_mount *); typedef void (*xfs_qmdone_t)(struct xfs_mount *);
typedef void (*xfs_dqrele_t)(struct xfs_dquot *); typedef void (*xfs_dqrele_t)(struct xfs_dquot *);
...@@ -158,8 +158,8 @@ typedef struct xfs_qmops { ...@@ -158,8 +158,8 @@ typedef struct xfs_qmops {
#define XFS_QM_INIT(mp, mnt, fl) \ #define XFS_QM_INIT(mp, mnt, fl) \
(*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl) (*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl)
#define XFS_QM_MOUNT(mp, mnt, fl, mfsi_flags) \ #define XFS_QM_MOUNT(mp, mnt, fl) \
(*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl, mfsi_flags) (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl)
#define XFS_QM_UNMOUNT(mp) \ #define XFS_QM_UNMOUNT(mp) \
(*(mp)->m_qm_ops->xfs_qmunmount)(mp) (*(mp)->m_qm_ops->xfs_qmunmount)(mp)
#define XFS_QM_DONE(mp) \ #define XFS_QM_DONE(mp) \
...@@ -442,13 +442,6 @@ void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, ...@@ -442,13 +442,6 @@ void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
/* /*
* Flags for xfs_mountfs * Flags for xfs_mountfs
*/ */
#define XFS_MFSI_SECOND 0x01 /* Secondary mount -- skip stuff */
#define XFS_MFSI_CLIENT 0x02 /* Is a client -- skip lots of stuff */
/* XFS_MFSI_RRINODES */
#define XFS_MFSI_NOUNLINK 0x08 /* Skip unlinked inode processing in */
/* log recovery */
#define XFS_MFSI_NO_QUOTACHECK 0x10 /* Skip quotacheck processing */
/* XFS_MFSI_CONVERT_SUNIT */
#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */ #define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */
#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
...@@ -517,7 +510,7 @@ typedef struct xfs_mod_sb { ...@@ -517,7 +510,7 @@ typedef struct xfs_mod_sb {
extern void xfs_mod_sb(xfs_trans_t *, __int64_t); extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
extern int xfs_log_sbcount(xfs_mount_t *, uint); extern int xfs_log_sbcount(xfs_mount_t *, uint);
extern int xfs_mountfs(xfs_mount_t *mp, int); extern int xfs_mountfs(xfs_mount_t *mp);
extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); extern void xfs_mountfs_check_barriers(xfs_mount_t *mp);
extern int xfs_unmountfs(xfs_mount_t *); extern int xfs_unmountfs(xfs_mount_t *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment