Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <xfs/xfs.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <iostream>
- using namespace std;
- #if 0
- typedef struct xfs_flock64 {
- __s16 l_type;
- __s16 l_whence;
- __s64 l_start;
- __s64 l_len; /* len == 0 means until end of file */
- __s32 l_sysid;
- __u32 l_pid;
- __s32 l_pad[4]; /* reserve area */
- } xfs_flock64_t;
- #endif
- int main(int argc, char** argv) {
- assert(argc == 2);
- int fd = open(argv[1], O_RDWR);
- assert(fd >= 0);
- assert(platform_test_xfs_fd(fd));
- xfs_flock64_t cmd;
- memset(&cmd, 0, sizeof(cmd));
- cmd.l_whence = 0; // from star tof file
- cmd.l_start = 0;
- cmd.l_len = 4096;
- int ret = xfsctl(NULL, fd, XFS_IOC_UNRESVSP64, &cmd);
- cout << ret << endl;
- close(fd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement