Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <xfs/xfs.h>
  2. #include <fcntl.h>
  3. #include <unistd.h>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. #if 0
  9. typedef struct xfs_flock64 {
  10. __s16 l_type;
  11. __s16 l_whence;
  12. __s64 l_start;
  13. __s64 l_len; /* len == 0 means until end of file */
  14. __s32 l_sysid;
  15. __u32 l_pid;
  16. __s32 l_pad[4]; /* reserve area */
  17. } xfs_flock64_t;
  18. #endif
  19.  
  20. int main(int argc, char** argv) {
  21. assert(argc == 2);
  22.  
  23. int fd = open(argv[1], O_RDWR);
  24. assert(fd >= 0);
  25.  
  26. assert(platform_test_xfs_fd(fd));
  27. xfs_flock64_t cmd;
  28. memset(&cmd, 0, sizeof(cmd));
  29. cmd.l_whence = 0; // from star tof file
  30. cmd.l_start = 0;
  31. cmd.l_len = 4096;
  32. int ret = xfsctl(NULL, fd, XFS_IOC_UNRESVSP64, &cmd);
  33. cout << ret << endl;
  34.  
  35. close(fd);
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement