10 int blktrace_lookup_device(const char *redirect, char *path, unsigned int maj,
22 while ((dir = readdir(D)) != NULL) {
25 if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
28 sprintf(full_path, "%s%s%s", path, FIO_OS_PATH_SEPARATOR, dir->d_name);
29 if (lstat(full_path, &st) == -1) {
34 if (S_ISDIR(st.st_mode)) {
35 found = blktrace_lookup_device(redirect, full_path,
38 strcpy(path, full_path);
43 if (!S_ISBLK(st.st_mode))
47 * If replay_redirect is set then always return this device
48 * upon lookup which overrides the device lookup based on
49 * major minor in the actual blktrace
52 strcpy(path, redirect);
57 if (maj == major(st.st_rdev) && min == minor(st.st_rdev)) {
58 strcpy(path, full_path);