Re: [PATCH v10 04/41] btrfs: get zone information of zoned block devices

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

 



On Wed, Nov 25, 2020 at 11:50:39PM +0000, Damien Le Moal wrote:
> Hi David,
> 
> On Wed, 2020-11-25 at 22:47 +0100, David Sterba wrote:
> > On Tue, Nov 10, 2020 at 08:26:07PM +0900, Naohiro Aota wrote:
> > > +int btrfs_get_dev_zone_info(struct btrfs_device *device)
> > > +{
> > > +	struct btrfs_zoned_device_info *zone_info = NULL;
> > > +	struct block_device *bdev = device->bdev;
> > > +	sector_t nr_sectors = bdev->bd_part->nr_sects;
> > > +	sector_t sector = 0;
> > 
> > I'd rather replace the sector_t types with u64. The type is unsigned
> > long and does not have the same width on 32/64 bit. The typecasts must
> > be used and if not, bugs happen (and happened).
> 
> Since kernel 5.2, sector_t is unconditionally defined as u64 in linux/type.h:
> 
> typedef u64 sector_t;
> 
> CONFIG_LBDAF does not exist anymore.

That's great, I was not aware of that.

> I am not against using u64 at all, but using sector_t makes it clear what the
> unit is for the values at hand.

Yeah agreed, I'll switch it back.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux