mirror of
https://github.com/nilfs-dev/nilfs-utils.git
synced 2026-01-26 05:37:51 +00:00
Introduce a new open flag NILFS_OPEN_SRCHDEV. If this flag is set and the 'dev' argument is a file or directory on a NILFS filesystem, nilfs_open() automatically locates the backing block device. The logic calls the internal helper function nilfs_lookup_device() to retrieve the device ID from the given path and resolve the canonical device path (e.g. "/dev/sda1") via sysfs. To support this, the source file "lookup_device.c" is added to the build list in lib/Makefile.am. This feature eliminates the need for users or tools to explicitly specify the block device path when operating on a mounted NILFS filesystem. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>