aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2005-11-01 23:01:12 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 23:01:12 -0500
commit1149d96ae825a1e1e9d66774175372c003f29caf (patch)
treebfc8b5c03a39283228922e711fd2675bd281db50 /fs/xfs/xfs_log_recover.c
parentfa7e7d71e05f12921fefdc23386183578d3ed8c7 (diff)
[XFS] endianess annotations and cleanup for the quota code
SGI-PV: 943272 SGI-Modid: xfs-linux:xfs-kern:199767a Signed-off-by: Christoph Hellwig <hch@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c58
1 files changed, 27 insertions, 31 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index b628c9eca420..63268984762a 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1998,79 +1998,74 @@ xfs_qm_dqcheck(
1998 * This is all fine; things are still consistent, and we haven't lost 1998 * This is all fine; things are still consistent, and we haven't lost
1999 * any quota information. Just don't complain about bad dquot blks. 1999 * any quota information. Just don't complain about bad dquot blks.
2000 */ 2000 */
2001 if (INT_GET(ddq->d_magic, ARCH_CONVERT) != XFS_DQUOT_MAGIC) { 2001 if (be16_to_cpu(ddq->d_magic) != XFS_DQUOT_MAGIC) {
2002 if (flags & XFS_QMOPT_DOWARN) 2002 if (flags & XFS_QMOPT_DOWARN)
2003 cmn_err(CE_ALERT, 2003 cmn_err(CE_ALERT,
2004 "%s : XFS dquot ID 0x%x, magic 0x%x != 0x%x", 2004 "%s : XFS dquot ID 0x%x, magic 0x%x != 0x%x",
2005 str, id, 2005 str, id, be16_to_cpu(ddq->d_magic), XFS_DQUOT_MAGIC);
2006 INT_GET(ddq->d_magic, ARCH_CONVERT), XFS_DQUOT_MAGIC);
2007 errs++; 2006 errs++;
2008 } 2007 }
2009 if (INT_GET(ddq->d_version, ARCH_CONVERT) != XFS_DQUOT_VERSION) { 2008 if (ddq->d_version != XFS_DQUOT_VERSION) {
2010 if (flags & XFS_QMOPT_DOWARN) 2009 if (flags & XFS_QMOPT_DOWARN)
2011 cmn_err(CE_ALERT, 2010 cmn_err(CE_ALERT,
2012 "%s : XFS dquot ID 0x%x, version 0x%x != 0x%x", 2011 "%s : XFS dquot ID 0x%x, version 0x%x != 0x%x",
2013 str, id, 2012 str, id, ddq->d_version, XFS_DQUOT_VERSION);
2014 INT_GET(ddq->d_magic, ARCH_CONVERT), XFS_DQUOT_VERSION);
2015 errs++; 2013 errs++;
2016 } 2014 }
2017 2015
2018 if (INT_GET(ddq->d_flags, ARCH_CONVERT) != XFS_DQ_USER && 2016 if (ddq->d_flags != XFS_DQ_USER &&
2019 INT_GET(ddq->d_flags, ARCH_CONVERT) != XFS_DQ_PROJ && 2017 ddq->d_flags != XFS_DQ_PROJ &&
2020 INT_GET(ddq->d_flags, ARCH_CONVERT) != XFS_DQ_GROUP) { 2018 ddq->d_flags != XFS_DQ_GROUP) {
2021 if (flags & XFS_QMOPT_DOWARN) 2019 if (flags & XFS_QMOPT_DOWARN)
2022 cmn_err(CE_ALERT, 2020 cmn_err(CE_ALERT,
2023 "%s : XFS dquot ID 0x%x, unknown flags 0x%x", 2021 "%s : XFS dquot ID 0x%x, unknown flags 0x%x",
2024 str, id, INT_GET(ddq->d_flags, ARCH_CONVERT)); 2022 str, id, ddq->d_flags);
2025 errs++; 2023 errs++;
2026 } 2024 }
2027 2025
2028 if (id != -1 && id != INT_GET(ddq->d_id, ARCH_CONVERT)) { 2026 if (id != -1 && id != be32_to_cpu(ddq->d_id)) {
2029 if (flags & XFS_QMOPT_DOWARN) 2027 if (flags & XFS_QMOPT_DOWARN)
2030 cmn_err(CE_ALERT, 2028 cmn_err(CE_ALERT,
2031 "%s : ondisk-dquot 0x%p, ID mismatch: " 2029 "%s : ondisk-dquot 0x%p, ID mismatch: "
2032 "0x%x expected, found id 0x%x", 2030 "0x%x expected, found id 0x%x",
2033 str, ddq, id, INT_GET(ddq->d_id, ARCH_CONVERT)); 2031 str, ddq, id, be32_to_cpu(ddq->d_id));
2034 errs++; 2032 errs++;
2035 } 2033 }
2036 2034
2037 if (!errs && ddq->d_id) { 2035 if (!errs && ddq->d_id) {
2038 if (INT_GET(ddq->d_blk_softlimit, ARCH_CONVERT) && 2036 if (ddq->d_blk_softlimit &&
2039 INT_GET(ddq->d_bcount, ARCH_CONVERT) >= 2037 be64_to_cpu(ddq->d_bcount) >=
2040 INT_GET(ddq->d_blk_softlimit, ARCH_CONVERT)) { 2038 be64_to_cpu(ddq->d_blk_softlimit)) {
2041 if (!ddq->d_btimer) { 2039 if (!ddq->d_btimer) {
2042 if (flags & XFS_QMOPT_DOWARN) 2040 if (flags & XFS_QMOPT_DOWARN)
2043 cmn_err(CE_ALERT, 2041 cmn_err(CE_ALERT,
2044 "%s : Dquot ID 0x%x (0x%p) " 2042 "%s : Dquot ID 0x%x (0x%p) "
2045 "BLK TIMER NOT STARTED", 2043 "BLK TIMER NOT STARTED",
2046 str, (int) 2044 str, (int)be32_to_cpu(ddq->d_id), ddq);
2047 INT_GET(ddq->d_id, ARCH_CONVERT), ddq);
2048 errs++; 2045 errs++;
2049 } 2046 }
2050 } 2047 }
2051 if (INT_GET(ddq->d_ino_softlimit, ARCH_CONVERT) && 2048 if (ddq->d_ino_softlimit &&
2052 INT_GET(ddq->d_icount, ARCH_CONVERT) >= 2049 be64_to_cpu(ddq->d_icount) >=
2053 INT_GET(ddq->d_ino_softlimit, ARCH_CONVERT)) { 2050 be64_to_cpu(ddq->d_ino_softlimit)) {
2054 if (!ddq->d_itimer) { 2051 if (!ddq->d_itimer) {
2055 if (flags & XFS_QMOPT_DOWARN) 2052 if (flags & XFS_QMOPT_DOWARN)
2056 cmn_err(CE_ALERT, 2053 cmn_err(CE_ALERT,
2057 "%s : Dquot ID 0x%x (0x%p) " 2054 "%s : Dquot ID 0x%x (0x%p) "
2058 "INODE TIMER NOT STARTED", 2055 "INODE TIMER NOT STARTED",
2059 str, (int) 2056 str, (int)be32_to_cpu(ddq->d_id), ddq);
2060 INT_GET(ddq->d_id, ARCH_CONVERT), ddq);
2061 errs++; 2057 errs++;
2062 } 2058 }
2063 } 2059 }
2064 if (INT_GET(ddq->d_rtb_softlimit, ARCH_CONVERT) && 2060 if (ddq->d_rtb_softlimit &&
2065 INT_GET(ddq->d_rtbcount, ARCH_CONVERT) >= 2061 be64_to_cpu(ddq->d_rtbcount) >=
2066 INT_GET(ddq->d_rtb_softlimit, ARCH_CONVERT)) { 2062 be64_to_cpu(ddq->d_rtb_softlimit)) {
2067 if (!ddq->d_rtbtimer) { 2063 if (!ddq->d_rtbtimer) {
2068 if (flags & XFS_QMOPT_DOWARN) 2064 if (flags & XFS_QMOPT_DOWARN)
2069 cmn_err(CE_ALERT, 2065 cmn_err(CE_ALERT,
2070 "%s : Dquot ID 0x%x (0x%p) " 2066 "%s : Dquot ID 0x%x (0x%p) "
2071 "RTBLK TIMER NOT STARTED", 2067 "RTBLK TIMER NOT STARTED",
2072 str, (int) 2068 str, (int)be32_to_cpu(ddq->d_id), ddq);
2073 INT_GET(ddq->d_id, ARCH_CONVERT), ddq);
2074 errs++; 2069 errs++;
2075 } 2070 }
2076 } 2071 }
@@ -2088,10 +2083,11 @@ xfs_qm_dqcheck(
2088 ASSERT(id != -1); 2083 ASSERT(id != -1);
2089 ASSERT(flags & XFS_QMOPT_DQREPAIR); 2084 ASSERT(flags & XFS_QMOPT_DQREPAIR);
2090 memset(d, 0, sizeof(xfs_dqblk_t)); 2085 memset(d, 0, sizeof(xfs_dqblk_t));
2091 INT_SET(d->dd_diskdq.d_magic, ARCH_CONVERT, XFS_DQUOT_MAGIC); 2086
2092 INT_SET(d->dd_diskdq.d_version, ARCH_CONVERT, XFS_DQUOT_VERSION); 2087 d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
2093 INT_SET(d->dd_diskdq.d_id, ARCH_CONVERT, id); 2088 d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
2094 INT_SET(d->dd_diskdq.d_flags, ARCH_CONVERT, type); 2089 d->dd_diskdq.d_flags = type;
2090 d->dd_diskdq.d_id = cpu_to_be32(id);
2095 2091
2096 return errs; 2092 return errs;
2097} 2093}