auto_fs.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed
  25. * back to the kernel via ioctl from userspace. On architectures where 32- and
  26. * 64-bit userspace binaries can be executed it's important that the size of
  27. * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we
  28. * do not break the binary ABI interface by changing the structure size.
  29. */
  30. #if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */
  31. typedef unsigned long autofs_wqt_t;
  32. #else
  33. typedef unsigned int autofs_wqt_t;
  34. #endif
  35. /* Packet types */
  36. #define autofs_ptype_missing 0 /* Missing entry (mount request) */
  37. #define autofs_ptype_expire 1 /* Expire entry (umount request) */
  38. struct autofs_packet_hdr {
  39. int proto_version; /* Protocol version */
  40. int type; /* Type of packet */
  41. };
  42. struct autofs_packet_missing {
  43. struct autofs_packet_hdr hdr;
  44. autofs_wqt_t wait_queue_token;
  45. int len;
  46. char name[NAME_MAX+1];
  47. };
  48. /* v3 expire (via ioctl) */
  49. struct autofs_packet_expire {
  50. struct autofs_packet_hdr hdr;
  51. int len;
  52. char name[NAME_MAX+1];
  53. };
  54. #define AUTOFS_IOC_READY _IO(0x93,0x60)
  55. #define AUTOFS_IOC_FAIL _IO(0x93,0x61)
  56. #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
  57. #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
  58. #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t)
  59. #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
  60. #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
  61. #endif /* _UAPI_LINUX_AUTO_FS_H */