auto_fs4.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* -*- c -*-
  2. * linux/include/linux/auto_fs4.h
  3. *
  4. * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
  5. *
  6. * This file is part of the Linux kernel and is made available under
  7. * the terms of the GNU General Public License, version 2, or at your
  8. * option, any later version, incorporated herein by reference.
  9. */
  10. #ifndef _LINUX_AUTO_FS4_H
  11. #define _LINUX_AUTO_FS4_H
  12. /* Include common v3 definitions */
  13. #include <linux/auto_fs.h>
  14. /* autofs v4 definitions */
  15. #undef AUTOFS_PROTO_VERSION
  16. #undef AUTOFS_MIN_PROTO_VERSION
  17. #undef AUTOFS_MAX_PROTO_VERSION
  18. #define AUTOFS_PROTO_VERSION 5
  19. #define AUTOFS_MIN_PROTO_VERSION 3
  20. #define AUTOFS_MAX_PROTO_VERSION 5
  21. #define AUTOFS_PROTO_SUBVERSION 1
  22. /* Mask for expire behaviour */
  23. #define AUTOFS_EXP_IMMEDIATE 1
  24. #define AUTOFS_EXP_LEAVES 2
  25. #define AUTOFS_TYPE_ANY 0x0000
  26. #define AUTOFS_TYPE_INDIRECT 0x0001
  27. #define AUTOFS_TYPE_DIRECT 0x0002
  28. #define AUTOFS_TYPE_OFFSET 0x0004
  29. /* Daemon notification packet types */
  30. enum autofs_notify {
  31. NFY_NONE,
  32. NFY_MOUNT,
  33. NFY_EXPIRE
  34. };
  35. /* Kernel protocol version 4 packet types */
  36. /* Expire entry (umount request) */
  37. #define autofs_ptype_expire_multi 2
  38. /* Kernel protocol version 5 packet types */
  39. /* Indirect mount missing and expire requests. */
  40. #define autofs_ptype_missing_indirect 3
  41. #define autofs_ptype_expire_indirect 4
  42. /* Direct mount missing and expire requests */
  43. #define autofs_ptype_missing_direct 5
  44. #define autofs_ptype_expire_direct 6
  45. /* v4 multi expire (via pipe) */
  46. struct autofs_packet_expire_multi {
  47. struct autofs_packet_hdr hdr;
  48. autofs_wqt_t wait_queue_token;
  49. int len;
  50. char name[NAME_MAX+1];
  51. };
  52. union autofs_packet_union {
  53. struct autofs_packet_hdr hdr;
  54. struct autofs_packet_missing missing;
  55. struct autofs_packet_expire expire;
  56. struct autofs_packet_expire_multi expire_multi;
  57. };
  58. /* autofs v5 common packet struct */
  59. struct autofs_v5_packet {
  60. struct autofs_packet_hdr hdr;
  61. autofs_wqt_t wait_queue_token;
  62. __u32 dev;
  63. __u64 ino;
  64. __u32 uid;
  65. __u32 gid;
  66. __u32 pid;
  67. __u32 tgid;
  68. __u32 len;
  69. char name[NAME_MAX+1];
  70. };
  71. typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
  72. typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
  73. typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
  74. typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
  75. union autofs_v5_packet_union {
  76. struct autofs_packet_hdr hdr;
  77. struct autofs_v5_packet v5_packet;
  78. autofs_packet_missing_indirect_t missing_indirect;
  79. autofs_packet_expire_indirect_t expire_indirect;
  80. autofs_packet_missing_direct_t missing_direct;
  81. autofs_packet_expire_direct_t expire_direct;
  82. };
  83. #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
  84. #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
  85. #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
  86. #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
  87. #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
  88. #endif /* _LINUX_AUTO_FS4_H */