Re: [PATCH v1.1 1/3] btrfs: tree-checker: Add EXTENT_ITEM and METADATA_ITEM check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2019/8/8 下午10:54, David Sterba wrote:
> On Wed, Aug 07, 2019 at 10:08:41PM +0800, Qu Wenruo wrote:
>> +
>> +static int check_extent_item(struct extent_buffer *leaf,
>> +			     struct btrfs_key *key, int slot)
>> +{
>> +	struct btrfs_fs_info *fs_info = leaf->fs_info;
>> +	struct btrfs_extent_item *ei;
>> +	bool is_tree_block = false;
>> +	u64 ptr;	/* Current pointer inside inline refs */
> 
> While u64 is wide enough, I suggest to use unsigned long as the
> intermediate type for pointer conversions.

In fact, we only need u32 for pointer.
(u16 is enough for 0~64k-1 but I'm not sure if we would use 64K as offset)

So regular unsigned int should be enough?

Thanks,
Qu




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux