Re: libblkid: Idea to force given cached entry to be invalidated?

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

 




-------- Original Message --------
Subject: Re: libblkid: Idea to force given cached entry to be invalidated?
From: Theodore Ts'o <tytso@xxxxxxx>
To: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
Date: 2014年04月15日 12:27
On Tue, Apr 15, 2014 at 10:15:01AM +0800, Qu Wenruo wrote:
Though the above patch try to avoid the whole cache, it's not good enough
since it break the pricible not
to probe the devices too frequently.

After some searching, it seems that libblkid does not provide such API, or
am I missing something?
The blkid_verify() function is designed to make sure the information
in the cache corresponds with reality.  If it does not, it will update
the cache to match with reality, so it will do what you want.

Using blkid_verify() will involve accessing the disk involved, but
that's still better than the alternative of scanning all of the disks
in the system.

Cheers,

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
I hope I was wrong but according to the codes, blkid_verify() seems still using the cache:
------
blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
{
......
            (diff < BLKID_PROBE_MIN ||
                (dev->bid_flags & BLKID_BID_FL_VERIFIED &&
                 diff < BLKID_PROBE_INTERVAL)))
                return dev;
------

So it seems not working in the case.

Also in the btrfs-progs codes, it has already called blkid_verify() before operations.

Thanks,
Qu.
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux