+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
* All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
#include "xfs_arch.h"
#include "xfs_fs.h"
+#include "crc32c.h"
/* CRC stuff, buffer API dependent on it */
-extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
-extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
-
-#define crc32(c,p,l) crc32_le((c),(unsigned char const *)(p),(l))
#define crc32c(c,p,l) crc32c_le((c),(unsigned char const *)(p),(l))
#include "xfs_cksum.h"
#define xfs_notice(mp,fmt,args...) cmn_err(CE_NOTE,fmt, ## args)
#define xfs_warn(mp,fmt,args...) cmn_err(CE_WARN,fmt, ## args)
+#define xfs_err(mp,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
+#define xfs_alert(mp,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
+#define xfs_alert_tag(mp,tag,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
+
#define xfs_hex_dump(d,n) ((void) 0)
#define xfs_force_shutdown(d,n) ((void) 0)
/* stop unused var warnings by assigning mp to itself */
-#define xfs_corruption_error(fu,e,l,mp,fi,ln,fa) do { \
+#define xfs_corruption_error(e,l,mp,b,sz,fi,ln,fa) do { \
(mp) = (mp); \
cmn_err(CE_ALERT, "%s: XFS_CORRUPTION_ERROR", (e)); \
} while (0)
-#define XFS_CORRUPTION_ERROR(e,l,mp,m) do { \
+#define XFS_CORRUPTION_ERROR(e, lvl, mp, buf, bufsize) do { \
(mp) = (mp); \
cmn_err(CE_ALERT, "%s: XFS_CORRUPTION_ERROR", (e)); \
} while (0)
})
#define xfs_buf_readahead_map(a,b,c,ops) ((void) 0) /* no readahead */
-#define xfs_warn(mp,fmt,args...) cmn_err(CE_WARN,fmt, ## args)
-#define xfs_alert(mp,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
-#define xfs_alert_tag(mp,tag,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
-
#define xfs_sort qsort
#define xfs_ilock(ip,mode) ((void) 0)
typedef unsigned char u8;
unsigned int hweight8(unsigned int w);
+unsigned int hweight32(unsigned int w);
+unsigned int hweight64(__u64 w);
#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)