Pfcache/API
Kernel pfcache API is described in linux/pfcache.h
Contents
Filesystem attributes
xattr "trusted.pfcache" (PFCACHE_XATTR_NAME)
for directories: "auto" -- checksum files at create, inherited from parent on mkdir.
for regular files: SHA-1 checksum, 40 (PFCACHE_CSUM_SIZE * 2) chars length hex string.
ioctls
FS_IOC_PFCACHE_OPEN
ioctl(fd, FS_IOC_PFCACHE_OPEN)
Try to reopen pfcache peer for this inode
| -EPERM | no cap-sys-admin |
| -ENODATA | no checksum |
| -ENODEV | no prcache on fs |
| -ENOENT | cache peer not found |
| -EBUSY | already opened |
| -EINVAL | cache peer does not match or not regular file |
| -EMLINK | cache peer has itself cache peer, or symlinks mess |
| -ETXTBSY | cache peer opened for write |
| ... plus all the open(2) error codes | |
| 0 | success! |
FS_IOC_PFCACHE_CLOSE
ioctl(fd, FS_IOC_PFCACHE_CLOSE)
Close pfcache peer for this inode inode
| -EPERM | no cap-sys-admin |
| -ENOENT | not opened |
| 0 | success |
FS_IOC_PFCACHE_DUMP
ioctl(fd, FS_IOC_PFCACHE_DUMP, struct pfcache_dump_request *)
Dump in-memory inodes for this fs, see linux/pfcache.h for description.
| -EPERM | no cap-sys-admin |
| -EINVAL | - |
| -EINTR | - |
| >=0 | Number of dumped inodes |