auto_fs.h 2.4 KB

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