#if defined(DEBUG) || defined(XLOG_NOLOG) /* * When logbufs == 0, someone has disabled the log from the FSTAB * file.  This is not a documented feature.  We need to set xlog_debug * to zero (this deactivates the log) and set xlog_target to the * appropriate device.  Only one filesystem may be affected as such * since this is just a performance hack to test what we might be able * 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; 
if (mp->m_logbufs <= 0) { 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; 
xlog_get_iclog_buffer_size(xfs_mount_t	*mp,			   xlog_t	*log){	int size;	int xhdrs;#if defined(DEBUG) || defined(XLOG_NOLOG)	/*	 * When logbufs == 0, someone has disabled the log from the FSTAB	 * file.  This is not a documented feature.  We need to set xlog_debug	 * to zero (this deactivates the log) and set xlog_target to the	 * appropriate device.  Only one filesystem may be affected as such	 * since this is just a performance hack to test what we might be able	 * 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	}	/*	 * Buffer size passed in from mount system call.	 */	if (mp->m_logbsize != -1) {		size = log->l_iclog_size = mp->m_logbsize;		log->l_iclog_size_log = 0;		while (size != 1) {			log->l_iclog_size_log++;			size >>= 1;		}		if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) {			/* # headers = size / 32K			 * one header holds cycles from 32K of data			 */			xhdrs = mp->m_logbsize / XLOG_HEADER_CYCLE_SIZE;			if (mp->m_logbsize % XLOG_HEADER_CYCLE_SIZE)				xhdrs++;			log->l_iclog_hsize = xhdrs << BBSHIFT;			log->l_iclog_heads = xhdrs;		} else {			ASSERT(mp->m_logbsize <= XLOG_BIG_RECORD_BSIZE);			log->l_iclog_hsize = BBSIZE;			log->l_iclog_heads = 1;		}		return;	}	/*	 * Special case machines that have less than 32MB of memory.	 * All machines with more memory use 32KB buffers.	 */	if (xfs_physmem <= btoc(32*1024*1024)) {		/* Don't change; min configuration */		log->l_iclog_size = XLOG_RECORD_BSIZE;		/* 16k */		log->l_iclog_size_log = XLOG_RECORD_BSHIFT;	} else {		log->l_iclog_size = XLOG_BIG_RECORD_BSIZE;	/* 32k */		log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT;	}	/* the default log size is 16k or 32k which is one header sector */	log->l_iclog_hsize = BBSIZE;	log->l_iclog_heads = 1;	/*	 * For 16KB, we use 3 32KB buffers.  For 32KB block sizes, we use	 * 4 32KB buffers.  For 64KB block sizes, we use 8 32KB buffers.	 */	if (mp->m_sb.sb_blocksize >= 16*1024) {		log->l_iclog_size = XLOG_BIG_RECORD_BSIZE;		log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT;		if (mp->m_logbufs == -1) {			switch (mp->m_sb.sb_blocksize) {			    case 16*1024:			/* 16 KB */				log->l_iclog_bufs = 3;				break;			    case 32*1024:			/* 32 KB */				log->l_iclog_bufs = 4;				break;			    case 64*1024:			/* 64 KB */				log->l_iclog_bufs = 8;				break;			    default:				xlog_panic("XFS: Invalid blocksize");				break;			}		}	}}	/* xlog_get_iclog_buffer_size */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/cfcbbbd089eadcaa86abb2c0f352e1ab23e16f72/xfs_log.c/buggy/fs/xfs/xfs_log.c