mirror of
https://github.com/versity/scoutfs.git
synced 2025-12-23 05:25:18 +00:00
scoutfs: fix sparse errors
I was building against a RHEL tree that broke sparse builds. With that fixed I can now see and fix sparse errors. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -25,12 +25,13 @@
|
||||
#include "msg.h"
|
||||
#include "block.h"
|
||||
#include "ring.h"
|
||||
#include "chunk.h"
|
||||
|
||||
void scoutfs_set_chunk_alloc_bits(struct super_block *sb,
|
||||
struct scoutfs_ring_bitmap *bm)
|
||||
{
|
||||
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
|
||||
u64 off = le64_to_cpu(bm->offset) * ARRAY_SIZE(bm->bits);
|
||||
u64 off = le32_to_cpu(bm->offset) * ARRAY_SIZE(bm->bits);
|
||||
|
||||
/* XXX check for corruption */
|
||||
|
||||
@@ -66,7 +67,7 @@ int scoutfs_alloc_chunk(struct super_block *sb, u64 *blkno)
|
||||
clear_bit_le(bit, sbi->chunk_alloc_bits);
|
||||
|
||||
off = round_down(bit, sizeof(bm.bits) * 8);
|
||||
bm.offset = le32_to_cpu(off);
|
||||
bm.offset = cpu_to_le32(off);
|
||||
|
||||
off *= ARRAY_SIZE(bm.bits);
|
||||
bm.bits[0] = sbi->chunk_alloc_bits[off];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include "msg.h"
|
||||
|
||||
void scoutfs_msg(struct super_block *sb, const char *prefix, const char *str,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
|
||||
@@ -155,7 +155,8 @@ static int read_supers(struct super_block *sb)
|
||||
|
||||
/* Initialize all the sb info fields which depends on the supers. */
|
||||
|
||||
bytes = DIV_ROUND_UP(sbi->super.total_chunks, 64) * sizeof(u64);
|
||||
bytes = DIV_ROUND_UP(le64_to_cpu(sbi->super.total_chunks), 64) *
|
||||
sizeof(u64);
|
||||
sbi->chunk_alloc_bits = vmalloc(bytes);
|
||||
if (!sbi->chunk_alloc_bits)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user