| 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 | |
|---|
| 17 | #include <linux/ioctl.h> |
|---|
| 18 | |
|---|
| 19 | /* This file describes autofs v3 */ |
|---|
| 20 | #define AUTOFS_PROTO_VERSION 3 |
|---|
| 21 | |
|---|
| 22 | /* Range of protocol versions defined */ |
|---|
| 23 | #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION |
|---|
| 24 | #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION |
|---|
| 25 | |
|---|
| 26 | /* |
|---|
| 27 | * Architectures where both 32- and 64-bit binaries can be executed |
|---|
| 28 | * on 64-bit kernels need this. This keeps the structure format |
|---|
| 29 | * uniform, and makes sure the wait_queue_token isn't too big to be |
|---|
| 30 | * passed back down to the kernel. |
|---|
| 31 | * |
|---|
| 32 | * This assumes that on these architectures: |
|---|
| 33 | * mode 32 bit 64 bit |
|---|
| 34 | * ------------------------- |
|---|
| 35 | * int 32 bit 32 bit |
|---|
| 36 | * long 32 bit 64 bit |
|---|
| 37 | * |
|---|
| 38 | * If so, 32-bit user-space code should be backwards compatible. |
|---|
| 39 | */ |
|---|
| 40 | |
|---|
| 41 | #if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \ |
|---|
| 42 | || defined(__powerpc__) || defined(__s390__) |
|---|
| 43 | typedef unsigned int autofs_wqt_t; |
|---|
| 44 | #else |
|---|
| 45 | typedef unsigned long autofs_wqt_t; |
|---|
| 46 | #endif |
|---|
| 47 | |
|---|
| 48 | /* Packet types */ |
|---|
| 49 | #define autofs_ptype_missing 0 /* Missing entry (mount request) */ |
|---|
| 50 | #define autofs_ptype_expire 1 /* Expire entry (umount request) */ |
|---|
| 51 | |
|---|
| 52 | struct autofs_packet_hdr { |
|---|
| 53 | int proto_version; /* Protocol version */ |
|---|
| 54 | int type; /* Type of packet */ |
|---|
| 55 | }; |
|---|
| 56 | |
|---|
| 57 | struct autofs_packet_missing { |
|---|
| 58 | struct autofs_packet_hdr hdr; |
|---|
| 59 | autofs_wqt_t wait_queue_token; |
|---|
| 60 | int len; |
|---|
| 61 | char name[NAME_MAX+1]; |
|---|
| 62 | }; |
|---|
| 63 | |
|---|
| 64 | /* v3 expire (via ioctl) */ |
|---|
| 65 | struct autofs_packet_expire { |
|---|
| 66 | struct autofs_packet_hdr hdr; |
|---|
| 67 | int len; |
|---|
| 68 | char name[NAME_MAX+1]; |
|---|
| 69 | }; |
|---|
| 70 | |
|---|
| 71 | #define AUTOFS_IOC_READY _IO(0x93,0x60) |
|---|
| 72 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) |
|---|
| 73 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) |
|---|
| 74 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) |
|---|
| 75 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) |
|---|
| 76 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) |
|---|
| 77 | |
|---|
| 78 | #endif /* _LINUX_AUTO_FS_H */ |
|---|