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