io fileinfo_t
Structure
The fileinfo_t
structure provides information about a file. The file to which an I/O corresponds is pointed to by args[2]
in the start
, done
, wait-start
, and wait-done
probes. The presence of file information is contingent upon the filesystem providing this information when dispatching I/O requests. Some filesystems, especially third-party filesystems, might not provide this information. Also, I/O requests might emanate from a filesystem for which no file information exists. For example, any I/O to filesystem metadata will not be associated with any one file. Finally, some highly optimized filesystems might aggregate I/O from disjoint files into a single I/O request. In this case, the filesystem might provide the file information either for the file that represents the majority of the I/O or for the file that represents some of the I/O. Alternately, the filesystem might provide no file information at all in this case.
The definition of the fileinfo_t
structure is as follows:
typedef struct fileinfo { string fi_name; /* name (basename of fi_pathname) */ string fi_dirname; /* directory (dirname of fi_pathname) */ string fi_pathname; /* full pathname */ offset_t fi_offset; /* offset within file */ string fi_fs; /* filesystem */ string fi_mount; /* mount point of file system */ } fileinfo_t;
The fi_name
field contains the name of the file but does not include any directory components. If no file information is associated with an I/O, the fi_name
field will be set to the string <none
>. In some rare cases, the path name associated with a file might be unknown. In this case, the fi_name
field will be set to the string <unknown
>.
The fi_dirname
field contains only the directory component of the file name. As with fi_name
, this string may be set to <none
> if no file information is present, or <unknown
> if the path name associated with the file is not known.
The fi_pathname
field contains the full path name to the file. As with fi_name
, this string may be set to <none
> if no file information is present, or <unknown
> if the path name associated with the file is not known.
The fi_offset
field contains the offset within the file, or -1 if either file information is not present or if the offset is otherwise unspecified by the filesystem.