Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Pfcache/API

1,436 bytes added, 11:17, 21 February 2012
created
Kernel pfcache API is described in linux/pfcache.h

== 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

{| class="wikitable"
|+ Exit codes
|| -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
|-
| colspan="2" | ... 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

{| class="wikitable"
|+ Exit codes
| -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.

{| class="wikitable"
|+ Exit codes
| -EPERM || no cap-sys-admin
|-
| -EINVAL || -
|-
| -EINTR || -
|-
| >=0 || Number of dumped inodes
|}