No actual bugs, just quiet the sparse checker.
Fixes sparse warnings about this.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
*/
if (xfs_sb_version_hascrc(sb) && !xfs_sb_version_hasmetauuid(sb) &&
!uuid_equal(&tcarg->uuid, &sb->sb_uuid)) {
- __be32 feat;
+ uint32_t feat;
feat = be32_to_cpu(ag_hdr->xfs_sb->sb_features_incompat);
feat |= XFS_SB_FEAT_INCOMPAT_META_UUID;
flist_t *sfl;
int bit_length;
int parentoffset;
- int crc;
+ uint32_t crc;
sfl = fl;
parentoffset = 0;
bit_length *= fcount(sfl->fld, iocur_top->data, parentoffset);
crc = getbitval(iocur_top->data, sfl->offset, bit_length,
BVUNSIGNED);
- /* Off by one.. */
- crc = cpu_to_be32(crc + 1);
+ /* Off by one, ignore endianness - we're just corrupting it. */
+ crc++;
setbitval(iocur_top->data, sfl->offset, bit_length, &crc);
/* Temporarily remove write verifier to write a bad CRC */
char *endp;
char *rbuf;
char *ostr;
- __u64 *value;
+ __be64 *value;
__u64 val = 0;
if (bit_length <= 64)
buf = xrealloc(buf, alloc_size);
memset(buf, 0, alloc_size);
- value = (__u64 *)buf;
+ value = (__be64 *)buf;
rbuf = buf;
if (*arg == '\"') {
xfs_dir2_sf_hdr_t *sfp,
int size)
{
+ __be64 pino; /* parent inode nr */
xfs_ino_t ino;
int count;
int i;
printf(_("SHORTFORM DIRECTORY size %d count %d\n"),
size, sfp->count);
- memmove(&ino, &(sfp->parent), sizeof(ino));
- printf(_(".. ino 0x%llx\n"), (unsigned long long) be64_to_cpu(ino));
+ memmove(&pino, &(sfp->parent), sizeof(pino));
+ printf(_(".. ino 0x%llx\n"), (unsigned long long) be64_to_cpu(pino));
count = sfp->count;
sfep = xfs_dir2_sf_firstentry(sfp);
*/
agfl_bno = XFS_BUF_TO_AGFL_BNO(mp, agflbp);
b = agfl_bno + ag_rmaps[agno].ar_flcount;
- while (*b != NULLAGBLOCK && b - agfl_bno < libxfs_agfl_size(mp)) {
+ while (*b != cpu_to_be32(NULLAGBLOCK) &&
+ b - agfl_bno < libxfs_agfl_size(mp)) {
error = rmap_add_ag_rec(mp, agno, be32_to_cpu(*b), 1,
XFS_RMAP_OWN_AG);
if (error)