auto_fs4.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 0
  22. /* Mask for expire behaviour */
  23. #define AUTOFS_EXP_IMMEDIATE 1
  24. #define AUTOFS_EXP_LEAVES 2
  25. /* Daemon notification packet types */
  26. enum autofs_notify {
  27. NFY_NONE,
  28. NFY_MOUNT,
  29. NFY_EXPIRE
  30. };
  31. /* Kernel protocol version 4 packet types */
  32. /* Expire entry (umount request) */
  33. #define autofs_ptype_expire_multi 2
  34. /* Kernel protocol version 5 packet types */
  35. /* Indirect mount missing and expire requests. */
  36. #define autofs_ptype_missing_indirect 3
  37. #define autofs_ptype_expire_indirect 4
  38. /* Direct mount missing and expire requests */
  39. #define autofs_ptype_missing_direct 5
  40. #define autofs_ptype_expire_direct 6
  41. /* v4 multi expire (via pipe) */
  42. struct autofs_packet_expire_multi {
  43. struct autofs_packet_hdr hdr;
  44. autofs_wqt_t wait_queue_token;
  45. int len;
  46. char name[NAME_MAX+1];
  47. };
  48. union autofs_packet_union {
  49. struct autofs_packet_hdr hdr;
  50. struct autofs_packet_missing missing;
  51. struct autofs_packet_expire expire;
  52. struct autofs_packet_expire_multi expire_multi;
  53. };
  54. /* autofs v5 common packet struct */
  55. struct autofs_v5_packet {
  56. struct autofs_packet_hdr hdr;
  57. autofs_wqt_t wait_queue_token;
  58. __u32 dev;
  59. __u64 ino;
  60. __u32 uid;
  61. __u32 gid;
  62. __u32 pid;
  63. __u32 tgid;
  64. __u32 len;
  65. char name[NAME_MAX+1];
  66. };
  67. typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
  68. typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
  69. typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
  70. typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
  71. union autofs_v5_packet_union {
  72. struct autofs_packet_hdr hdr;
  73. struct autofs_v5_packet v5_packet;
  74. autofs_packet_missing_indirect_t missing_indirect;
  75. autofs_packet_expire_indirect_t expire_indirect;
  76. autofs_packet_missing_direct_t missing_direct;
  77. autofs_packet_expire_direct_t expire_direct;
  78. };
  79. #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
  80. #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
  81. #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
  82. #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
  83. #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
  84. #endif /* _LINUX_AUTO_FS4_H */