Commit dcb3b83f authored by Eric Sandeen's avatar Eric Sandeen Committed by Tim Shimmin

[XFS] clean up xfs_start_flags

xfs_start_flags can make use of is_power_of_2 to tidy up the test a little
bit.

SGI-PV: 968563
SGI-Modid: xfs-linux-melb:xfs-kern:29327a
Signed-off-by: default avatarEric Sandeen <sandeen@sandeen.net>
Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent af3a2e8a
...@@ -35,11 +35,11 @@ struct xfs_mount; ...@@ -35,11 +35,11 @@ struct xfs_mount;
#define XLOG_VERSION_1 1 #define XLOG_VERSION_1 1
#define XLOG_VERSION_2 2 /* Large IClogs, Log sunit */ #define XLOG_VERSION_2 2 /* Large IClogs, Log sunit */
#define XLOG_VERSION_OKBITS (XLOG_VERSION_1 | XLOG_VERSION_2) #define XLOG_VERSION_OKBITS (XLOG_VERSION_1 | XLOG_VERSION_2)
#define XLOG_RECORD_BSIZE (16*1024) /* eventually 32k */ #define XLOG_MIN_RECORD_BSIZE (16*1024) /* eventually 32k */
#define XLOG_BIG_RECORD_BSIZE (32*1024) /* 32k buffers */ #define XLOG_BIG_RECORD_BSIZE (32*1024) /* 32k buffers */
#define XLOG_MAX_RECORD_BSIZE (256*1024) #define XLOG_MAX_RECORD_BSIZE (256*1024)
#define XLOG_HEADER_CYCLE_SIZE (32*1024) /* cycle data in header */ #define XLOG_HEADER_CYCLE_SIZE (32*1024) /* cycle data in header */
#define XLOG_RECORD_BSHIFT 14 /* 16384 == 1 << 14 */ #define XLOG_MIN_RECORD_BSHIFT 14 /* 16384 == 1 << 14 */
#define XLOG_BIG_RECORD_BSHIFT 15 /* 32k == 1 << 15 */ #define XLOG_BIG_RECORD_BSHIFT 15 /* 32k == 1 << 15 */
#define XLOG_MAX_RECORD_BSHIFT 18 /* 256k == 1 << 18 */ #define XLOG_MAX_RECORD_BSHIFT 18 /* 256k == 1 << 18 */
#define XLOG_BTOLSUNIT(log, b) (((b)+(log)->l_mp->m_sb.sb_logsunit-1) / \ #define XLOG_BTOLSUNIT(log, b) (((b)+(log)->l_mp->m_sb.sb_logsunit-1) / \
......
...@@ -238,11 +238,9 @@ xfs_start_flags( ...@@ -238,11 +238,9 @@ 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 != 0 &&
ap->logbufsize != 16 * 1024 && (ap->logbufsize < XLOG_MIN_RECORD_BSIZE ||
ap->logbufsize != 32 * 1024 && ap->logbufsize > XLOG_MAX_RECORD_BSIZE ||
ap->logbufsize != 64 * 1024 && !is_power_of_2(ap->logbufsize))) {
ap->logbufsize != 128 * 1024 &&
ap->logbufsize != 256 * 1024) {
cmn_err(CE_WARN, cmn_err(CE_WARN,
"XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]",
ap->logbufsize); ap->logbufsize);
......
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