ocfs2_ioctl.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* -*- mode: c; c-basic-offset: 8; -*-
  2. * vim: noexpandtab sw=8 ts=8 sts=0:
  3. *
  4. * ocfs2_ioctl.h
  5. *
  6. * Defines OCFS2 ioctls.
  7. *
  8. * Copyright (C) 2010 Oracle. All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public
  12. * License, version 2, as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. */
  19. #ifndef OCFS2_IOCTL_H
  20. #define OCFS2_IOCTL_H
  21. /*
  22. * ioctl commands
  23. */
  24. #define OCFS2_IOC_GETFLAGS _IOR('f', 1, long)
  25. #define OCFS2_IOC_SETFLAGS _IOW('f', 2, long)
  26. #define OCFS2_IOC32_GETFLAGS _IOR('f', 1, int)
  27. #define OCFS2_IOC32_SETFLAGS _IOW('f', 2, int)
  28. /*
  29. * Space reservation / allocation / free ioctls and argument structure
  30. * are designed to be compatible with XFS.
  31. *
  32. * ALLOCSP* and FREESP* are not and will never be supported, but are
  33. * included here for completeness.
  34. */
  35. struct ocfs2_space_resv {
  36. __s16 l_type;
  37. __s16 l_whence;
  38. __s64 l_start;
  39. __s64 l_len; /* len == 0 means until end of file */
  40. __s32 l_sysid;
  41. __u32 l_pid;
  42. __s32 l_pad[4]; /* reserve area */
  43. };
  44. #define OCFS2_IOC_ALLOCSP _IOW ('X', 10, struct ocfs2_space_resv)
  45. #define OCFS2_IOC_FREESP _IOW ('X', 11, struct ocfs2_space_resv)
  46. #define OCFS2_IOC_RESVSP _IOW ('X', 40, struct ocfs2_space_resv)
  47. #define OCFS2_IOC_UNRESVSP _IOW ('X', 41, struct ocfs2_space_resv)
  48. #define OCFS2_IOC_ALLOCSP64 _IOW ('X', 36, struct ocfs2_space_resv)
  49. #define OCFS2_IOC_FREESP64 _IOW ('X', 37, struct ocfs2_space_resv)
  50. #define OCFS2_IOC_RESVSP64 _IOW ('X', 42, struct ocfs2_space_resv)
  51. #define OCFS2_IOC_UNRESVSP64 _IOW ('X', 43, struct ocfs2_space_resv)
  52. /* Used to pass group descriptor data when online resize is done */
  53. struct ocfs2_new_group_input {
  54. __u64 group; /* Group descriptor's blkno. */
  55. __u32 clusters; /* Total number of clusters in this group */
  56. __u32 frees; /* Total free clusters in this group */
  57. __u16 chain; /* Chain for this group */
  58. __u16 reserved1;
  59. __u32 reserved2;
  60. };
  61. #define OCFS2_IOC_GROUP_EXTEND _IOW('o', 1, int)
  62. #define OCFS2_IOC_GROUP_ADD _IOW('o', 2,struct ocfs2_new_group_input)
  63. #define OCFS2_IOC_GROUP_ADD64 _IOW('o', 3,struct ocfs2_new_group_input)
  64. /* Used to pass 2 file names to reflink. */
  65. struct reflink_arguments {
  66. __u64 old_path;
  67. __u64 new_path;
  68. __u64 preserve;
  69. };
  70. #define OCFS2_IOC_REFLINK _IOW('o', 4, struct reflink_arguments)
  71. #endif /* OCFS2_IOCTL_H */