auto_fs.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright 1997 Transmeta Corporation - All Rights Reserved
  3. *
  4. * This file is part of the Linux kernel and is made available under
  5. * the terms of the GNU General Public License, version 2, or at your
  6. * option, any later version, incorporated herein by reference.
  7. *
  8. * ----------------------------------------------------------------------- */
  9. #ifndef _UAPI_LINUX_AUTO_FS_H
  10. #define _UAPI_LINUX_AUTO_FS_H
  11. #include <linux/types.h>
  12. #include <linux/limits.h>
  13. #ifndef __KERNEL__
  14. #include <sys/ioctl.h>
  15. #endif /* __KERNEL__ */
  16. /* This file describes autofs v3 */
  17. #define AUTOFS_PROTO_VERSION 3
  18. /* Range of protocol versions defined */
  19. #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
  20. #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
  21. /*
  22. * The wait_queue_entry_token (autofs_wqt_t) is part of a structure which is passed
  23. * back to the kernel via ioctl from userspace. On architectures where 32- and
  24. * 64-bit userspace binaries can be executed it's important that the size of
  25. * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we
  26. * do not break the binary ABI interface by changing the structure size.
  27. */
  28. #if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */
  29. typedef unsigned long autofs_wqt_t;
  30. #else
  31. typedef unsigned int autofs_wqt_t;
  32. #endif
  33. /* Packet types */
  34. #define autofs_ptype_missing 0 /* Missing entry (mount request) */
  35. #define autofs_ptype_expire 1 /* Expire entry (umount request) */
  36. struct autofs_packet_hdr {
  37. int proto_version; /* Protocol version */
  38. int type; /* Type of packet */
  39. };
  40. struct autofs_packet_missing {
  41. struct autofs_packet_hdr hdr;
  42. autofs_wqt_t wait_queue_entry_token;
  43. int len;
  44. char name[NAME_MAX+1];
  45. };
  46. /* v3 expire (via ioctl) */
  47. struct autofs_packet_expire {
  48. struct autofs_packet_hdr hdr;
  49. int len;
  50. char name[NAME_MAX+1];
  51. };
  52. #define AUTOFS_IOCTL 0x93
  53. enum {
  54. AUTOFS_IOC_READY_CMD = 0x60,
  55. AUTOFS_IOC_FAIL_CMD,
  56. AUTOFS_IOC_CATATONIC_CMD,
  57. AUTOFS_IOC_PROTOVER_CMD,
  58. AUTOFS_IOC_SETTIMEOUT_CMD,
  59. AUTOFS_IOC_EXPIRE_CMD,
  60. };
  61. #define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD)
  62. #define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD)
  63. #define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD)
  64. #define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, AUTOFS_IOC_PROTOVER_CMD, int)
  65. #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, compat_ulong_t)
  66. #define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, unsigned long)
  67. #define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, AUTOFS_IOC_EXPIRE_CMD, struct autofs_packet_expire)
  68. #endif /* _UAPI_LINUX_AUTO_FS_H */