auto_fs.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 _UAPI_LINUX_AUTO_FS_H
  13. #define _UAPI_LINUX_AUTO_FS_H
  14. #include <linux/types.h>
  15. #ifndef __KERNEL__
  16. #include <sys/ioctl.h>
  17. #endif /* __KERNEL__ */
  18. /* This file describes autofs v3 */
  19. #define AUTOFS_PROTO_VERSION 3
  20. /* Range of protocol versions defined */
  21. #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
  22. #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
  23. /*
  24. * Architectures where both 32- and 64-bit binaries can be executed
  25. * on 64-bit kernels need this. This keeps the structure format
  26. * uniform, and makes sure the wait_queue_token isn't too big to be
  27. * passed back down to the kernel.
  28. *
  29. * This assumes that on these architectures:
  30. * mode 32 bit 64 bit
  31. * -------------------------
  32. * int 32 bit 32 bit
  33. * long 32 bit 64 bit
  34. *
  35. * If so, 32-bit user-space code should be backwards compatible.
  36. */
  37. #if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
  38. || defined(__powerpc__) || defined(__s390__)
  39. typedef unsigned int autofs_wqt_t;
  40. #else
  41. typedef unsigned long autofs_wqt_t;
  42. #endif
  43. /* Packet types */
  44. #define autofs_ptype_missing 0 /* Missing entry (mount request) */
  45. #define autofs_ptype_expire 1 /* Expire entry (umount request) */
  46. struct autofs_packet_hdr {
  47. int proto_version; /* Protocol version */
  48. int type; /* Type of packet */
  49. };
  50. struct autofs_packet_missing {
  51. struct autofs_packet_hdr hdr;
  52. autofs_wqt_t wait_queue_token;
  53. int len;
  54. char name[NAME_MAX+1];
  55. };
  56. /* v3 expire (via ioctl) */
  57. struct autofs_packet_expire {
  58. struct autofs_packet_hdr hdr;
  59. int len;
  60. char name[NAME_MAX+1];
  61. };
  62. #define AUTOFS_IOC_READY _IO(0x93,0x60)
  63. #define AUTOFS_IOC_FAIL _IO(0x93,0x61)
  64. #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
  65. #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
  66. #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t)
  67. #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
  68. #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
  69. #endif /* _UAPI_LINUX_AUTO_FS_H */