-static int fuser_scan_pid_maps(int opts, const char *fname, pid_t pid,
- inode_list *ilist, pid_list *plist)
-{
- FILE *file;
- char line[FUSER_MAX_LINE + 1];
- int major, minor;
- ino_t inode;
- long long uint64_inode;
- dev_t dev;
-
- file = fopen(fname, "r");
- if (!file)
- return 0;
- while (fgets(line, FUSER_MAX_LINE, file)) {
- if (sscanf(line, "%*s %*s %*s %x:%x %llu", &major, &minor, &uint64_inode) != 3)
- continue;
- inode = uint64_inode;
- if (major == 0 && minor == 0 && inode == 0)
- continue;
- dev = makedev(major, minor);
- if (fuser_search_dev_inode(opts, ilist, dev, inode)) {
- fuser_add_pid(plist, pid);
- }
- }
- fclose(file);
- return 1;
-}
-
-static int fuser_scan_link(int opts, const char *lname, pid_t pid,
- inode_list *ilist, pid_list *plist)
-{
- ino_t inode;
- dev_t dev;
-
- if (!fuser_file_to_dev_inode(lname, &dev, &inode))
- return 0;
- if (fuser_search_dev_inode(opts, ilist, dev, inode))
- fuser_add_pid(plist, pid);
- return 1;
-}
-
-static int fuser_scan_dir_links(int opts, const char *dname, pid_t pid,
- inode_list *ilist, pid_list *plist)