if (devno <= 0)
continue;
- if (sysfs_devno_is_dm_private(devno, NULL) ||
+ if (sysfs_devno_is_dm_private(devno, NULL, NULL) ||
sysfs_devno_is_wholedisk(devno) <= 0)
continue;
size_t len,
dev_t *diskdevno);
+struct ul_vfs_ops;
+
int sysfs_devno_to_wholedisk(dev_t dev, char *diskname,
size_t len, dev_t *diskdevno);
-int sysfs_devno_is_dm_hidden(dev_t devno, char **uuid);
-int sysfs_devno_is_dm_private(dev_t devno, char **uuid);
+int sysfs_devno_is_dm_hidden(dev_t devno, char **uuid,
+ const struct ul_vfs_ops *vfs);
+int sysfs_devno_is_dm_private(dev_t devno, char **uuid,
+ const struct ul_vfs_ops *vfs);
int sysfs_devno_is_wholedisk(dev_t devno);
dev_t sysfs_devname_to_devno(const char *name);
*
* The @uuid (if not NULL) returns DM device UUID, use free() to deallocate.
*/
-int sysfs_devno_is_dm_hidden(dev_t devno, char **uuid)
+int sysfs_devno_is_dm_hidden(dev_t devno, char **uuid,
+ const struct ul_vfs_ops *vfs)
{
struct path_cxt *pc = NULL;
char *id = NULL;
pc = ul_new_sysfs_path(devno, NULL, NULL);
if (!pc)
goto done;
+ ul_path_refer_vfs(pc, vfs);
if (ul_path_read_string(pc, &id, "dm/uuid") <= 0 || !id)
goto done;
* Returns 1 if the device is private device mapper device. The @uuid
* (if not NULL) returns DM device UUID, use free() to deallocate.
*/
-int sysfs_devno_is_dm_private(dev_t devno, char **uuid)
+int sysfs_devno_is_dm_private(dev_t devno, char **uuid,
+ const struct ul_vfs_ops *vfs)
{
struct path_cxt *pc = NULL;
char *id = NULL;
pc = ul_new_sysfs_path(devno, NULL, NULL);
if (!pc)
goto done;
+ ul_path_refer_vfs(pc, vfs);
if (ul_path_read_string(pc, &id, "dm/uuid") <= 0 || !id)
goto done;
#ifndef _BLKID_BLKID_H
#define _BLKID_BLKID_H
+#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
struct stat sb;
if (stat(filename, &sb) == 0 && S_ISBLK(sb.st_mode) &&
- sysfs_devno_is_dm_hidden(sb.st_rdev, NULL)) {
+ sysfs_devno_is_dm_hidden(sb.st_rdev, NULL, pr->vfs)) {
DBG(LOWPROBE, ul_debug("ignore hidden device mapper device"));
errno = EINVAL;
return -EINVAL;
#endif
if (S_ISBLK(sb.st_mode) &&
!is_floppy &&
- sysfs_devno_is_dm_private(sb.st_rdev, &dm_uuid)) {
+ sysfs_devno_is_dm_private(sb.st_rdev, &dm_uuid, pr->vfs)) {
DBG(LOWPROBE, ul_debug("ignore private device mapper device"));
pr->flags |= BLKID_FL_NOSCAN_DEV;
}
pc = ul_new_sysfs_path(dev, NULL, NULL);
if (!pc)
return 1;
+ ul_path_refer_vfs(pc, pr->vfs);
rc = 1; /* nothing (default) */
(long long)diff));
#endif
- if (sysfs_devno_is_dm_private(st.st_rdev, NULL))
+ if (sysfs_devno_is_dm_private(st.st_rdev, NULL, NULL))
goto dev_free;
if (!cache->probe) {
cache->probe = blkid_new_probe();