Re: [PATCH] libblkid: implement zone-aware probing for HMZONED btrfs

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

 



On Thu, Dec 05, 2019 at 03:51:02PM +0100, Karel Zak wrote:
On Wed, Dec 04, 2019 at 05:30:23PM +0900, Naohiro Aota wrote:
 	while(mag && mag->magic) {
 		unsigned char *buf;
-
-		off = (mag->kboff + (mag->sboff >> 10)) << 10;
+		uint64_t kboff;
+
+		if (!mag->is_zone)
+			kboff = mag->kboff;
+		else {
+			uint32_t zone_size_sector;
+			int ret;
+
+			ret = ioctl(pr->fd, BLKGETZONESZ, &zone_size_sector);

I guess this ioctl returns always the same number, right?

If yes, than you don't want to call it always when libmount compares
any magic string. It would be better call it only once from
blkid_probe_set_device() and save zone_size_sector to struct
blkid_probe.

Exactly. That should save much time! I'll update the code in that
way. Thanks.

   Karel

--
Karel Zak  <kzak@xxxxxxxxxx>
http://karelzak.blogspot.com




[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