mirror of
https://github.com/nilfs-dev/nilfs-utils.git
synced 2026-01-26 13:43:15 +00:00
Add a new helper function, nilfs_lookup_device(), to resolve the kernel device name (e.g. "sda1") associated with a filesystem node (file or directory). This function internally uses a static helper, nilfs_get_devname_by_devid(), which reads the symlink at /sys/dev/block/<major>:<minor> to identify the canonical device name from a device ID. These helpers are separated into a standalone module to allow sharing the logic between the nilfs library and other utilities (e.g. nilfs-clean) without exposing internal symbols in the public API. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
12 lines
267 B
C
12 lines
267 B
C
/*
|
|
* lookup_device.h - Internal header for device lookup helper
|
|
*
|
|
* This file is not exported to users.
|
|
*/
|
|
#ifndef NILFS_LOOKUP_DEVICE_H
|
|
#define NILFS_LOOKUP_DEVICE_H
|
|
|
|
int nilfs_lookup_device(const char *node, char **devpath);
|
|
|
|
#endif /* NILFS_LOOKUP_DEVICE_H */
|