auto_fs.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* -*- linux-c -*- ------------------------------------------------------- *
  2. *
  3. * linux/include/linux/auto_fs.h
  4. *
  5. * Copyright 1997 Transmeta Corporation - All Rights Reserved
  6. *
  7. * This file is part of the Linux kernel and is made available under
  8. * the terms of the GNU General Public License, version 2, or at your
  9. * option, any later version, incorporated herein by reference.
  10. *
  11. * ----------------------------------------------------------------------- */
  12. #ifndef _LINUX_AUTO_FS_H
  13. #define _LINUX_AUTO_FS_H
  14. #ifdef __KERNEL__
  15. #include <linux/fs.h>
  16. #include <linux/limits.h>
  17. #include <asm/types.h>
  18. #endif /* __KERNEL__ */
  19. #include <linux/ioctl.h>
  20. /* This file describes autofs v3 */
  21. #define AUTOFS_PROTO_VERSION 3
  22. /* Range of protocol versions defined */
  23. #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
  24. #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
  25. /*
  26. * Architectures where both 32- and 64-bit binaries can be executed
  27. * on 64-bit kernels need this. This keeps the structure format
  28. * uniform, and makes sure the wait_queue_token isn't too big to be
  29. * passed back down to the kernel.
  30. *
  31. * This assumes that on these architectures:
  32. * mode 32 bit 64 bit
  33. * -------------------------
  34. * int 32 bit 32 bit
  35. * long 32 bit 64 bit
  36. *
  37. * If so, 32-bit user-space code should be backwards compatible.
  38. */
  39. #if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
  40. || defined(__powerpc__) || defined(__s390__)
  41. typedef unsigned int autofs_wqt_t;
  42. #else
  43. typedef unsigned long autofs_wqt_t;
  44. #endif
  45. /* Packet types */
  46. #define autofs_ptype_missing 0 /* Missing entry (mount request) */
  47. #define autofs_ptype_expire 1 /* Expire entry (umount request) */
  48. struct autofs_packet_hdr {
  49. int proto_version; /* Protocol version */
  50. int type; /* Type of packet */
  51. };
  52. struct autofs_packet_missing {
  53. struct autofs_packet_hdr hdr;
  54. autofs_wqt_t wait_queue_token;
  55. int len;
  56. char name[NAME_MAX+1];
  57. };
  58. /* v3 expire (via ioctl) */
  59. struct autofs_packet_expire {
  60. struct autofs_packet_hdr hdr;
  61. int len;
  62. char name[NAME_MAX+1];
  63. };
  64. #define AUTOFS_IOC_READY _IO(0x93,0x60)
  65. #define AUTOFS_IOC_FAIL _IO(0x93,0x61)
  66. #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
  67. #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
  68. #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
  69. #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
  70. #endif /* _LINUX_AUTO_FS_H */