auto_fs.h 2.7 KB

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