On Fri, Oct 31, 2014 at 07:04:58PM +0800, Anand Jain wrote: > > > > > On 31/10/2014 17:08, Karel Zak wrote: > >On Fri, Oct 31, 2014 at 12:11:20PM +0800, Anand Jain wrote: > >>btrfs_scan_lblikd() is called by most the device related command functions. > >>And btrfs_scan_lblkid() is most expensive function and it becomes more expensive > >>as number of devices in the system increase. Further some threads call this > > > >wouldn't be possible to ask udev rather than scan all devices? I > >understand than in some cases it's necessary to have robust and > >independent solution, but for usual use-cases it would be less > >expensive to read the info from udev where we already keep track about > >all block devices and where we call libblkid. > > > >It would be possible to implement it as optional feature (#ifdev HAVE_LIBUDEV), > >the library API is very easy to use. > > > >(For example lsblk uses libblkid as fallback, the default is udev). > > > > Karel > > > > > > I might be missing something, correct me if wrong. Is there any udev API > which gives me a list of devices which hold btrfs ? I just browsed > through there isn't any. See udev_enumerate_* API, nice example: http://www.signal11.us/oss/udev/ Anyway, I have sent patches that implement this feature to btrfs-progs. What I see critical is missing ./configure, because it's pretty ugly to add hardcoded dependencies (e.g. libudev), there is also no checks for another libs, Makefile does not care about place where libs are installed, header files, etc. etc. Is there any fundamental problem with autoconf? If no, then I'm ready to send patches with some autotools stuff. Comments? Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
