diff options
Diffstat (limited to 'kernel4/linux/auto_fs.h')
-rw-r--r-- | kernel4/linux/auto_fs.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/kernel4/linux/auto_fs.h b/kernel4/linux/auto_fs.h new file mode 100644 index 0000000..8819643 --- /dev/null +++ b/kernel4/linux/auto_fs.h @@ -0,0 +1,124 @@ +/* -*- linux-c -*- ------------------------------------------------------- * + * + * linux/include/linux/auto_fs.h + * + * Copyright 1997 Transmeta Corporation - All Rights Reserved + * + * This file is part of the Linux kernel and is made available under + * the terms of the GNU General Public License, version 2, or at your + * option, any later version, incorporated herein by reference. + * + * ----------------------------------------------------------------------- */ + + +#ifndef _LINUX_AUTO_FS_H +#define _LINUX_AUTO_FS_H + +#include <linux/version.h> +#include <linux/fs.h> +#include <linux/limits.h> +#include <linux/ioctl.h> +#include <asm/types.h> + +#define AUTOFS_PROTO_MAJOR_VERSION 4 +#define AUTOFS_PROTO_MINOR_VERSION 0 +#define AUTOFS_PROTO_FEATURES 0x00000000 + +#define AUTOFS_NAME_MAX 255 + +/* + * Previous protocol version differences: + * + * 1.0 - never distributed + * 2.0 - hdr.body_len field used for protocol version; only + * autofs_ptype_missing supported; IOC_READY, IOC_FAIL, IOC_CATATONIC + * only. + * 3.0 - hdr.body_len field used for protocol version; added support for + * IOC_PROTOVER, IOC_SETTIMEOUT, IOC_EXPIRE. + * + */ + +enum autofs_packet_type { + AUTOFS_PTYPE_MISSING, /* Missing entry (mount request) */ + AUTOFS_PTYPE_EXPIRE, /* Expire entry (umount request) */ +}; + +struct autofs_packet_hdr { + int body_len; /* Length of packet body in bytes */ + enum autofs_packet_type type; /* Type of packet */ +}; + +struct autofs_process_info { + int pid; /* pid of requesting process */ + int uid; /* fsuid of requesting process */ + int gid; /* fsgid of requesting process */ + int umask; /* umask of requesting process */ +}; + +struct autofs_packet_missing_body { + unsigned long wait_queue_token; + struct autofs_process_info pinfo; + unsigned long parent; /* parent "magic cookie" */ + int len; + char name[AUTOFS_NAME_MAX+1]; +}; + +struct autofs_packet_missing { + struct autofs_packet_hdr hdr; + struct autofs_packet_missing_body body; +}; + +/* Packet format for protocol versions 2-3 */ +struct autofs_v3_packet_missing { + struct autofs_packet_hdr hdr; /* body_len field not valid */ + int len; + char name[AUTOFS_NAME_MAX+1]; +}; + +struct autofs_packet_expire_body { + int len; + char name[AUTOFS_NAME_MAX+1]; +}; + +struct autofs_packet_expire { + struct autofs_packet_hdr hdr; + struct autofs_packet_expire_body body; +}; + +struct autofs_proto_info { + unsigned short major_ver; + unsigned short minor_ver; + unsigned long features; +}; + +enum autofs_dir_mode { + AUTOFS_DIR_LOCKED, + AUTOFS_DIR_UNLOCKED, + AUTOFS_DIR_MAGIC, + AUTOFS_DIR_MODECOUNT +}; + +struct autofs_set_dir_mode { + unsigned long inode; /* inode number */ + unsigned long cookie; /* magic cookie for AUTOFS_DIR_MAGIC */ + enum autofs_dir_mode mode; +}; + +#define AUTOFS_IOC_READY _IO(0x93,0x60) +#define AUTOFS_IOC_FAIL _IO(0x93,0x61) +#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) +#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) +#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) +#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) +#define AUTOFS_IOC_PROTOINFO _IOR(0x93,0x66,struct autofs_proto_info) +#define AUTOFS_IOC_ENABLE _IO(0x93,0x67) +#define AUTOFS_IOC_SETDIRMODE _IOW(0x93,0x68,struct autofs_set_dir_mode) + +#ifdef __KERNEL__ + +/* Init function */ +int init_autofs_fs(void); + +#endif /* __KERNEL__ */ + +#endif /* _LINUX_AUTO_FS_H */ |