From: Nathan Scott Date: Mon, 9 Sep 2002 08:50:34 +0000 (+0000) Subject: sync with kernel, minor changes only. X-Git-Tag: v2.4.0~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b6a0044a4ca5eabab1ad22a9e15ef38e88de645;p=thirdparty%2Fxfsprogs-dev.git sync with kernel, minor changes only. --- diff --git a/include/xfs_quota.h b/include/xfs_quota.h index a3962ec83..37639212e 100644 --- a/include/xfs_quota.h +++ b/include/xfs_quota.h @@ -65,16 +65,6 @@ typedef __uint16_t xfs_qwarncnt_t; #define XFS_UQUOTA_ACTIVE 0x0080 /* uquotas are being turned off */ #define XFS_GQUOTA_ACTIVE 0x0100 /* gquotas are being turned off */ -/* - * Typically, we turn quotas off if we weren't explicitly asked to - * mount quotas. This is the mount option not to do that. - * This option is handy in the miniroot, when trying to mount /root. - * We can't really know what's in /etc/fstab until /root is already mounted! - * This stops quotas getting turned off in the root filesystem everytime - * the system boots up a miniroot. - */ -#define XFS_QUOTA_MAYBE 0x0200 /* Turn quotas on if SB has quotas on */ - /* * Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees * quota will be not be switched off as long as that inode lock is held. diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c index 3ba5950c8..69d3e0f71 100644 --- a/libxlog/xfs_log_recover.c +++ b/libxlog/xfs_log_recover.c @@ -526,7 +526,7 @@ xlog_find_tail(xlog_t *log, xfs_lsn_t tail_lsn; int hblks; - found = error = 0; + found = 0; /* * Find previous log record @@ -551,10 +551,11 @@ xlog_find_tail(xlog_t *log, * Search backwards looking for log record header block */ ASSERT(*head_blk < INT_MAX); - for (i=(int)(*head_blk)-1; i>=0; i--) { + for (i = (int)(*head_blk) - 1; i >= 0; i--) { if ((error = xlog_bread(log, i, 1, bp))) goto bread_err; - if (INT_GET(*(uint *)(XFS_BUF_PTR(bp)), ARCH_CONVERT) == XLOG_HEADER_MAGIC_NUM) { + if (XLOG_HEADER_MAGIC_NUM == + INT_GET(*(uint *)(XFS_BUF_PTR(bp)), ARCH_CONVERT)) { found = 1; break; } @@ -566,10 +567,11 @@ xlog_find_tail(xlog_t *log, * the previous code. */ if (!found) { - for (i=log->l_logBBsize-1; i>=(int)(*head_blk); i--) { + for (i = log->l_logBBsize - 1; i >= (int)(*head_blk); i--) { if ((error = xlog_bread(log, i, 1, bp))) goto bread_err; - if (INT_GET(*(uint*)(XFS_BUF_PTR(bp)), ARCH_CONVERT) == XLOG_HEADER_MAGIC_NUM) { + if (XLOG_HEADER_MAGIC_NUM == + INT_GET(*(uint*)(XFS_BUF_PTR(bp)), ARCH_CONVERT)) { found = 2; break; } @@ -621,7 +623,8 @@ xlog_find_tail(xlog_t *log, if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) { int h_size = INT_GET(rhead->h_size, ARCH_CONVERT); int h_version = INT_GET(rhead->h_version, ARCH_CONVERT); - if ((h_version && XLOG_VERSION_2) && + + if ((h_version & XLOG_VERSION_2) && (h_size > XLOG_HEADER_CYCLE_SIZE)) { hblks = h_size / XLOG_HEADER_CYCLE_SIZE; if (h_size % XLOG_HEADER_CYCLE_SIZE) @@ -632,10 +635,11 @@ xlog_find_tail(xlog_t *log, } else { hblks = 1; } - after_umount_blk = (i + hblks + - (int)BTOBB(INT_GET(rhead->h_len, ARCH_CONVERT))) % log->l_logBBsize; + after_umount_blk = (i + hblks + (int) + BTOBB(INT_GET(rhead->h_len, ARCH_CONVERT))) % log->l_logBBsize; tail_lsn = log->l_tail_lsn; - if (*head_blk == after_umount_blk && INT_GET(rhead->h_num_logops, ARCH_CONVERT) == 1) { + if (*head_blk == after_umount_blk && + INT_GET(rhead->h_num_logops, ARCH_CONVERT) == 1) { umount_data_blk = (i + hblks) % log->l_logBBsize; if ((error = xlog_bread(log, umount_data_blk, 1, bp))) { goto bread_err;