[XFS] Remove old, broken nolog-mode code - noone plans to ever fix it.

SGI-PV: 944821
SGI-Modid: xfs-linux:xfs-kern:24213a

Signed-off-by: Nathan Scott <nathans@sgi.com>
This commit is contained in:
Nathan Scott 2005-11-02 15:12:04 +11:00
parent c11e2c369d
commit cfcbbbd089
4 changed files with 39 additions and 168 deletions

View file

@ -111,8 +111,7 @@ STATIC xlog_ticket_t *xlog_ticket_get(xlog_t *log,
uint flags); uint flags);
STATIC void xlog_ticket_put(xlog_t *log, xlog_ticket_t *ticket); STATIC void xlog_ticket_put(xlog_t *log, xlog_ticket_t *ticket);
/* local debug functions */ #if defined(DEBUG)
#if defined(DEBUG) && !defined(XLOG_NOLOG)
STATIC void xlog_verify_dest_ptr(xlog_t *log, __psint_t ptr); STATIC void xlog_verify_dest_ptr(xlog_t *log, __psint_t ptr);
STATIC void xlog_verify_grant_head(xlog_t *log, int equals); STATIC void xlog_verify_grant_head(xlog_t *log, int equals);
STATIC void xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog, STATIC void xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog,
@ -128,26 +127,7 @@ STATIC void xlog_verify_tail_lsn(xlog_t *log, xlog_in_core_t *iclog,
STATIC int xlog_iclogs_empty(xlog_t *log); STATIC int xlog_iclogs_empty(xlog_t *log);
#ifdef DEBUG
int xlog_do_error = 0;
int xlog_req_num = 0;
int xlog_error_mod = 33;
#endif
#define XLOG_FORCED_SHUTDOWN(log) (log->l_flags & XLOG_IO_ERROR)
/*
* 0 => disable log manager
* 1 => enable log manager
* 2 => enable log manager and log debugging
*/
#if defined(XLOG_NOLOG) || defined(DEBUG)
int xlog_debug = 1;
xfs_buftarg_t *xlog_target;
#endif
#if defined(XFS_LOG_TRACE) #if defined(XFS_LOG_TRACE)
void void
xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string) xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string)
{ {
@ -183,31 +163,16 @@ xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string)
void void
xlog_trace_iclog(xlog_in_core_t *iclog, uint state) xlog_trace_iclog(xlog_in_core_t *iclog, uint state)
{ {
pid_t pid;
pid = current_pid();
if (!iclog->ic_trace) if (!iclog->ic_trace)
iclog->ic_trace = ktrace_alloc(256, KM_SLEEP); iclog->ic_trace = ktrace_alloc(256, KM_SLEEP);
ktrace_enter(iclog->ic_trace, ktrace_enter(iclog->ic_trace,
(void *)((unsigned long)state), (void *)((unsigned long)state),
(void *)((unsigned long)pid), (void *)((unsigned long)current_pid()),
(void *)0, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,
(void *)0, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,
(void *)0, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,
(void *)0, (void *)NULL, (void *)NULL);
(void *)0,
(void *)0,
(void *)0,
(void *)0,
(void *)0,
(void *)0,
(void *)0,
(void *)0,
(void *)0,
(void *)0);
} }
#else #else
#define xlog_trace_loggrant(log,tic,string) #define xlog_trace_loggrant(log,tic,string)
#define xlog_trace_iclog(iclog,state) #define xlog_trace_iclog(iclog,state)
@ -244,11 +209,6 @@ xfs_log_done(xfs_mount_t *mp,
xlog_ticket_t *ticket = (xfs_log_ticket_t) xtic; xlog_ticket_t *ticket = (xfs_log_ticket_t) xtic;
xfs_lsn_t lsn = 0; xfs_lsn_t lsn = 0;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
if (XLOG_FORCED_SHUTDOWN(log) || if (XLOG_FORCED_SHUTDOWN(log) ||
/* /*
* If nothing was ever written, don't write out commit record. * If nothing was ever written, don't write out commit record.
@ -316,11 +276,6 @@ _xfs_log_force(
if (!log_flushed) if (!log_flushed)
log_flushed = &dummy; log_flushed = &dummy;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
ASSERT(flags & XFS_LOG_FORCE); ASSERT(flags & XFS_LOG_FORCE);
XFS_STATS_INC(xs_log_force); XFS_STATS_INC(xs_log_force);
@ -348,10 +303,6 @@ xfs_log_notify(xfs_mount_t *mp, /* mount of partition */
xlog_in_core_t *iclog = (xlog_in_core_t *)iclog_hndl; xlog_in_core_t *iclog = (xlog_in_core_t *)iclog_hndl;
int abortflg, spl; int abortflg, spl;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
cb->cb_next = NULL; cb->cb_next = NULL;
spl = LOG_LOCK(log); spl = LOG_LOCK(log);
abortflg = (iclog->ic_state & XLOG_STATE_IOERROR); abortflg = (iclog->ic_state & XLOG_STATE_IOERROR);
@ -402,13 +353,8 @@ xfs_log_reserve(xfs_mount_t *mp,
{ {
xlog_t *log = mp->m_log; xlog_t *log = mp->m_log;
xlog_ticket_t *internal_ticket; xlog_ticket_t *internal_ticket;
int retval; int retval = 0;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
retval = 0;
ASSERT(client == XFS_TRANSACTION || client == XFS_LOG); ASSERT(client == XFS_TRANSACTION || client == XFS_LOG);
ASSERT((flags & XFS_LOG_NOSLEEP) == 0); ASSERT((flags & XFS_LOG_NOSLEEP) == 0);
@ -470,13 +416,6 @@ xfs_log_mount(xfs_mount_t *mp,
mp->m_log = xlog_alloc_log(mp, log_target, blk_offset, num_bblks); mp->m_log = xlog_alloc_log(mp, log_target, blk_offset, num_bblks);
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug) {
cmn_err(CE_NOTE, "logdev: %s", mp->m_logname ?
mp->m_logname : "internal");
return 0;
}
#endif
/* /*
* skip log recovery on a norecovery mount. pretend it all * skip log recovery on a norecovery mount. pretend it all
* just worked. * just worked.
@ -580,11 +519,6 @@ xfs_log_unmount_write(xfs_mount_t *mp)
__uint32_t pad2; /* may as well make it 64 bits */ __uint32_t pad2; /* may as well make it 64 bits */
} magic = { XLOG_UNMOUNT_TYPE, 0, 0 }; } magic = { XLOG_UNMOUNT_TYPE, 0, 0 };
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
/* /*
* Don't write out unmount record on read-only mounts. * Don't write out unmount record on read-only mounts.
* Or, if we are doing a forced umount (typically because of IO errors). * Or, if we are doing a forced umount (typically because of IO errors).
@ -711,12 +645,6 @@ xfs_log_write(xfs_mount_t * mp,
int error; int error;
xlog_t *log = mp->m_log; xlog_t *log = mp->m_log;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ) {
*start_lsn = 0;
return 0;
}
#endif
if (XLOG_FORCED_SHUTDOWN(log)) if (XLOG_FORCED_SHUTDOWN(log))
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
@ -736,11 +664,6 @@ xfs_log_move_tail(xfs_mount_t *mp,
int need_bytes, free_bytes, cycle, bytes; int need_bytes, free_bytes, cycle, bytes;
SPLDECL(s); SPLDECL(s);
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ)
return;
#endif
/* XXXsup tmp */
if (XLOG_FORCED_SHUTDOWN(log)) if (XLOG_FORCED_SHUTDOWN(log))
return; return;
ASSERT(!XFS_FORCED_SHUTDOWN(mp)); ASSERT(!XFS_FORCED_SHUTDOWN(mp));
@ -1027,51 +950,22 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
int size; int size;
int xhdrs; int xhdrs;
#if defined(DEBUG) || defined(XLOG_NOLOG) if (mp->m_logbufs <= 0) {
/* if (xfs_physmem <= btoc(128*1024*1024)) {
* When logbufs == 0, someone has disabled the log from the FSTAB log->l_iclog_bufs = XLOG_MIN_ICLOGS;
* file. This is not a documented feature. We need to set xlog_debug } else if (xfs_physmem <= btoc(400*1024*1024)) {
* to zero (this deactivates the log) and set xlog_target to the log->l_iclog_bufs = XLOG_MED_ICLOGS;
* appropriate device. Only one filesystem may be affected as such } else { /* 256K with 32K bufs */
* since this is just a performance hack to test what we might be able log->l_iclog_bufs = XLOG_MAX_ICLOGS;
* to get if the log were not present.
*/
if (mp->m_logbufs == 0) {
xlog_debug = 0;
xlog_target = log->l_targ;
log->l_iclog_bufs = XLOG_MIN_ICLOGS;
} else
#endif
{
/*
* This is the normal path. If m_logbufs == -1, then the
* admin has chosen to use the system defaults for logbuffers.
*/
if (mp->m_logbufs == -1) {
if (xfs_physmem <= btoc(128*1024*1024)) {
log->l_iclog_bufs = XLOG_MIN_ICLOGS;
} else if (xfs_physmem <= btoc(400*1024*1024)) {
log->l_iclog_bufs = XLOG_MED_ICLOGS;
} else {
/* 256K with 32K bufs */
log->l_iclog_bufs = XLOG_MAX_ICLOGS;
}
} else
log->l_iclog_bufs = mp->m_logbufs;
#if defined(DEBUG) || defined(XLOG_NOLOG)
/* We are reactivating a filesystem after it was inactive */
if (log->l_targ == xlog_target) {
xlog_target = NULL;
xlog_debug = 1;
} }
#endif } else {
log->l_iclog_bufs = mp->m_logbufs;
} }
/* /*
* Buffer size passed in from mount system call. * Buffer size passed in from mount system call.
*/ */
if (mp->m_logbsize != -1) { if (mp->m_logbsize > 0) {
size = log->l_iclog_size = mp->m_logbsize; size = log->l_iclog_size = mp->m_logbsize;
log->l_iclog_size_log = 0; log->l_iclog_size_log = 0;
while (size != 1) { while (size != 1) {
@ -1094,7 +988,7 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
log->l_iclog_hsize = BBSIZE; log->l_iclog_hsize = BBSIZE;
log->l_iclog_heads = 1; log->l_iclog_heads = 1;
} }
return; goto done;
} }
/* /*
@ -1121,7 +1015,7 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
if (mp->m_sb.sb_blocksize >= 16*1024) { if (mp->m_sb.sb_blocksize >= 16*1024) {
log->l_iclog_size = XLOG_BIG_RECORD_BSIZE; log->l_iclog_size = XLOG_BIG_RECORD_BSIZE;
log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT; log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT;
if (mp->m_logbufs == -1) { if (mp->m_logbufs <= 0) {
switch (mp->m_sb.sb_blocksize) { switch (mp->m_sb.sb_blocksize) {
case 16*1024: /* 16 KB */ case 16*1024: /* 16 KB */
log->l_iclog_bufs = 3; log->l_iclog_bufs = 3;
@ -1138,6 +1032,12 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
} }
} }
} }
done: /* are we being asked to make the sizes selected above visible? */
if (mp->m_logbufs == 0)
mp->m_logbufs = log->l_iclog_bufs;
if (mp->m_logbsize == 0)
mp->m_logbsize = log->l_iclog_size;
} /* xlog_get_iclog_buffer_size */ } /* xlog_get_iclog_buffer_size */
@ -3390,7 +3290,7 @@ xlog_ticket_get(xlog_t *log,
* *
****************************************************************************** ******************************************************************************
*/ */
#if defined(DEBUG) && !defined(XLOG_NOLOG) #if defined(DEBUG)
/* /*
* Make sure that the destination ptr is within the valid data region of * Make sure that the destination ptr is within the valid data region of
* one of the iclogs. This uses backup pointers stored in a different * one of the iclogs. This uses backup pointers stored in a different
@ -3554,7 +3454,7 @@ xlog_verify_iclog(xlog_t *log,
ptr += sizeof(xlog_op_header_t) + op_len; ptr += sizeof(xlog_op_header_t) + op_len;
} }
} /* xlog_verify_iclog */ } /* xlog_verify_iclog */
#endif /* DEBUG && !XLOG_NOLOG */ #endif
/* /*
* Mark all iclogs IOERROR. LOG_LOCK is held by the caller. * Mark all iclogs IOERROR. LOG_LOCK is held by the caller.

View file

@ -492,6 +492,8 @@ typedef struct log {
* alignment mask */ * alignment mask */
} xlog_t; } xlog_t;
#define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR)
#define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \
xlog_grant_sub_space(log,bytes,type) xlog_grant_sub_space(log,bytes,type)
static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) static inline void xlog_grant_sub_space(struct log *log, int bytes, int type)

View file

@ -176,12 +176,8 @@ xfs_trans_dup(
XFS_LBC_INIT(&(ntp->t_busy)); XFS_LBC_INIT(&(ntp->t_busy));
ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
#if defined(XLOG_NOLOG) || defined(DEBUG)
ASSERT(!xlog_debug || tp->t_ticket != NULL);
#else
ASSERT(tp->t_ticket != NULL); ASSERT(tp->t_ticket != NULL);
#endif
ntp->t_flags = XFS_TRANS_PERM_LOG_RES | (tp->t_flags & XFS_TRANS_RESERVE); ntp->t_flags = XFS_TRANS_PERM_LOG_RES | (tp->t_flags & XFS_TRANS_RESERVE);
ntp->t_ticket = tp->t_ticket; ntp->t_ticket = tp->t_ticket;
ntp->t_blk_res = tp->t_blk_res - tp->t_blk_res_used; ntp->t_blk_res = tp->t_blk_res - tp->t_blk_res_used;
@ -663,9 +659,6 @@ _xfs_trans_commit(
int sync; int sync;
#define XFS_TRANS_LOGVEC_COUNT 16 #define XFS_TRANS_LOGVEC_COUNT 16
xfs_log_iovec_t log_vector_fast[XFS_TRANS_LOGVEC_COUNT]; xfs_log_iovec_t log_vector_fast[XFS_TRANS_LOGVEC_COUNT];
#if defined(XLOG_NOLOG) || defined(DEBUG)
static xfs_lsn_t trans_lsn = 1;
#endif
void *commit_iclog; void *commit_iclog;
int shutdown; int shutdown;
@ -716,11 +709,7 @@ shut_us_down:
*commit_lsn_p = commit_lsn; *commit_lsn_p = commit_lsn;
return (shutdown); return (shutdown);
} }
#if defined(XLOG_NOLOG) || defined(DEBUG)
ASSERT(!xlog_debug || tp->t_ticket != NULL);
#else
ASSERT(tp->t_ticket != NULL); ASSERT(tp->t_ticket != NULL);
#endif
/* /*
* If we need to update the superblock, then do it now. * If we need to update the superblock, then do it now.
@ -737,14 +726,10 @@ shut_us_down:
* by using a vector from the stack when it fits. * by using a vector from the stack when it fits.
*/ */
nvec = xfs_trans_count_vecs(tp); nvec = xfs_trans_count_vecs(tp);
if (nvec == 0) { if (nvec == 0) {
xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); xfs_force_shutdown(mp, XFS_LOG_IO_ERROR);
goto shut_us_down; goto shut_us_down;
} } else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
log_vector = log_vector_fast; log_vector = log_vector_fast;
} else { } else {
log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec * log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec *
@ -758,30 +743,14 @@ shut_us_down:
*/ */
xfs_trans_fill_vecs(tp, log_vector); xfs_trans_fill_vecs(tp, log_vector);
/* error = xfs_log_write(mp, log_vector, nvec, tp->t_ticket, &(tp->t_lsn));
* Ignore errors here. xfs_log_done would do the right thing.
* We need to put the ticket, etc. away.
*/
error = xfs_log_write(mp, log_vector, nvec, tp->t_ticket,
&(tp->t_lsn));
#if defined(XLOG_NOLOG) || defined(DEBUG)
if (xlog_debug) {
commit_lsn = xfs_log_done(mp, tp->t_ticket,
&commit_iclog, log_flags);
} else {
commit_lsn = 0;
tp->t_lsn = trans_lsn++;
}
#else
/* /*
* This is the regular case. At this point (after the call finishes), * The transaction is committed incore here, and can go out to disk
* the transaction is committed incore and could go out to disk at * at any time after this call. However, all the items associated
* any time. However, all the items associated with the transaction * with the transaction are still locked and pinned in memory.
* are still locked and pinned in memory.
*/ */
commit_lsn = xfs_log_done(mp, tp->t_ticket, &commit_iclog, log_flags); commit_lsn = xfs_log_done(mp, tp->t_ticket, &commit_iclog, log_flags);
#endif
tp->t_commit_lsn = commit_lsn; tp->t_commit_lsn = commit_lsn;
if (nvec > XFS_TRANS_LOGVEC_COUNT) { if (nvec > XFS_TRANS_LOGVEC_COUNT) {

View file

@ -214,9 +214,7 @@ xfs_start_flags(
} }
if (ap->logbufs != -1 && if (ap->logbufs != -1 &&
#if defined(DEBUG) || defined(XLOG_NOLOG)
ap->logbufs != 0 && ap->logbufs != 0 &&
#endif
(ap->logbufs < XLOG_MIN_ICLOGS || (ap->logbufs < XLOG_MIN_ICLOGS ||
ap->logbufs > XLOG_MAX_ICLOGS)) { ap->logbufs > XLOG_MAX_ICLOGS)) {
cmn_err(CE_WARN, cmn_err(CE_WARN,
@ -226,6 +224,7 @@ xfs_start_flags(
} }
mp->m_logbufs = ap->logbufs; mp->m_logbufs = ap->logbufs;
if (ap->logbufsize != -1 && if (ap->logbufsize != -1 &&
ap->logbufsize != 0 &&
ap->logbufsize != 16 * 1024 && ap->logbufsize != 16 * 1024 &&
ap->logbufsize != 32 * 1024 && ap->logbufsize != 32 * 1024 &&
ap->logbufsize != 64 * 1024 && ap->logbufsize != 64 * 1024 &&
@ -1910,13 +1909,14 @@ xfs_showargs(
seq_printf(m, "," MNTOPT_IHASHSIZE "=%d", mp->m_ihsize); seq_printf(m, "," MNTOPT_IHASHSIZE "=%d", mp->m_ihsize);
if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE)
seq_printf(m, "," MNTOPT_ALLOCSIZE "=%d", 1<<mp->m_writeio_log); seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk",
(int)(1 << mp->m_writeio_log) >> 10);
if (mp->m_logbufs > 0) if (mp->m_logbufs > 0)
seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs);
if (mp->m_logbsize > 0) if (mp->m_logbsize > 0)
seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize); seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10);
if (mp->m_logname) if (mp->m_logname)
seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname); seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname);