#ifndef __ZVFS_HOOK_SEEK_H__ #define __ZVFS_HOOK_SEEK_H__ #include #include /* * lseek:更新 daemon handle 上的共享 offset。 * * truncate / ftruncate: * 更新 inode->logical_size,同步 st_size(ftruncate 到真实 fd), * 若 new_size < old_size,截断对 blob 的写入范围(blob_resize)。 * * fallocate / posix_fallocate: * zvfs 无"空洞"概念,blob 按需增长。 * 对 zvfs fd,fallocate 只更新 logical_size(预占逻辑空间), * 不调用 blob_resize(避免提前分配 SPDK cluster)。 * FALLOC_FL_KEEP_SIZE 模式:不改 logical_size,直接返回 0。 * FALLOC_FL_PUNCH_HOLE:暂不支持,返回 ENOTSUP。 */ off_t lseek(int fd, off_t offset, int whence); off_t lseek64(int fd, off_t offset, int whence); int truncate(const char *path, off_t length); int truncate64(const char *path, off_t length); int ftruncate(int fd, off_t length); int ftruncate64(int fd, off_t length); int fallocate(int fd, int mode, off_t offset, off_t len); int posix_fallocate(int fd, off_t offset, off_t len); #endif // __ZVFS_HOOK_SEEK_H__