|
Packit |
8480eb |
/* -*- c -*-
|
|
Packit |
8480eb |
* linux/include/linux/auto_fs4.h
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* This file is part of the Linux kernel and is made available under
|
|
Packit |
8480eb |
* the terms of the GNU General Public License, version 2, or at your
|
|
Packit |
8480eb |
* option, any later version, incorporated herein by reference.
|
|
Packit |
8480eb |
*/
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#ifndef _LINUX_AUTO_FS4_H
|
|
Packit |
8480eb |
#define _LINUX_AUTO_FS4_H
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Include common v3 definitions */
|
|
Packit |
8480eb |
#include <linux/types.h>
|
|
Packit |
8480eb |
#include <linux/auto_fs.h>
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* autofs v4 definitions */
|
|
Packit |
8480eb |
#undef AUTOFS_PROTO_VERSION
|
|
Packit |
8480eb |
#undef AUTOFS_MIN_PROTO_VERSION
|
|
Packit |
8480eb |
#undef AUTOFS_MAX_PROTO_VERSION
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#define AUTOFS_PROTO_VERSION 5
|
|
Packit |
8480eb |
#define AUTOFS_MIN_PROTO_VERSION 3
|
|
Packit |
8480eb |
#define AUTOFS_MAX_PROTO_VERSION 5
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#define AUTOFS_PROTO_SUBVERSION 2
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Mask for expire behaviour */
|
|
Packit |
8480eb |
#define AUTOFS_EXP_IMMEDIATE 1
|
|
Packit |
8480eb |
#define AUTOFS_EXP_LEAVES 2
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_ANY 0U
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_INDIRECT 1U
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_DIRECT 2U
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_OFFSET 4U
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline void set_autofs_type_indirect(unsigned int *type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
*type = AUTOFS_TYPE_INDIRECT;
|
|
Packit |
8480eb |
return;
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline unsigned int autofs_type_indirect(unsigned int type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
return (type == AUTOFS_TYPE_INDIRECT);
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline void set_autofs_type_direct(unsigned int *type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
*type = AUTOFS_TYPE_DIRECT;
|
|
Packit |
8480eb |
return;
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline unsigned int autofs_type_direct(unsigned int type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
return (type == AUTOFS_TYPE_DIRECT);
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline void set_autofs_type_offset(unsigned int *type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
*type = AUTOFS_TYPE_OFFSET;
|
|
Packit |
8480eb |
return;
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline unsigned int autofs_type_offset(unsigned int type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
return (type == AUTOFS_TYPE_OFFSET);
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline unsigned int autofs_type_trigger(unsigned int type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/*
|
|
Packit |
8480eb |
* This isn't really a type as we use it to say "no type set" to
|
|
Packit |
8480eb |
* indicate we want to search for "any" mount in the
|
|
Packit |
8480eb |
* autofs_dev_ioctl_ismountpoint() device ioctl function.
|
|
Packit |
8480eb |
*/
|
|
Packit |
8480eb |
static inline void set_autofs_type_any(unsigned int *type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
*type = AUTOFS_TYPE_ANY;
|
|
Packit |
8480eb |
return;
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
static inline unsigned int autofs_type_any(unsigned int type)
|
|
Packit |
8480eb |
{
|
|
Packit |
8480eb |
return (type == AUTOFS_TYPE_ANY);
|
|
Packit |
8480eb |
}
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Daemon notification packet types */
|
|
Packit |
8480eb |
enum autofs_notify {
|
|
Packit |
8480eb |
NFY_NONE,
|
|
Packit |
8480eb |
NFY_MOUNT,
|
|
Packit |
8480eb |
NFY_EXPIRE
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Kernel protocol version 4 packet types */
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Expire entry (umount request) */
|
|
Packit |
8480eb |
#define autofs_ptype_expire_multi 2
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Kernel protocol version 5 packet types */
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Indirect mount missing and expire requests. */
|
|
Packit |
8480eb |
#define autofs_ptype_missing_indirect 3
|
|
Packit |
8480eb |
#define autofs_ptype_expire_indirect 4
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* Direct mount missing and expire requests */
|
|
Packit |
8480eb |
#define autofs_ptype_missing_direct 5
|
|
Packit |
8480eb |
#define autofs_ptype_expire_direct 6
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* v4 multi expire (via pipe) */
|
|
Packit |
8480eb |
struct autofs_packet_expire_multi {
|
|
Packit |
8480eb |
struct autofs_packet_hdr hdr;
|
|
Packit |
8480eb |
autofs_wqt_t wait_queue_token;
|
|
Packit |
8480eb |
int len;
|
|
Packit |
8480eb |
char name[NAME_MAX+1];
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
union autofs_packet_union {
|
|
Packit |
8480eb |
struct autofs_packet_hdr hdr;
|
|
Packit |
8480eb |
struct autofs_packet_missing missing;
|
|
Packit |
8480eb |
struct autofs_packet_expire expire;
|
|
Packit |
8480eb |
struct autofs_packet_expire_multi expire_multi;
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
/* autofs v5 common packet struct */
|
|
Packit |
8480eb |
struct autofs_v5_packet {
|
|
Packit |
8480eb |
struct autofs_packet_hdr hdr;
|
|
Packit |
8480eb |
autofs_wqt_t wait_queue_token;
|
|
Packit |
8480eb |
__u32 dev;
|
|
Packit |
8480eb |
__u64 ino;
|
|
Packit |
8480eb |
__u32 uid;
|
|
Packit |
8480eb |
__u32 gid;
|
|
Packit |
8480eb |
__u32 pid;
|
|
Packit |
8480eb |
__u32 tgid;
|
|
Packit |
8480eb |
__u32 len;
|
|
Packit |
8480eb |
char name[NAME_MAX+1];
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
|
|
Packit |
8480eb |
typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
|
|
Packit |
8480eb |
typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
|
|
Packit |
8480eb |
typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
union autofs_v5_packet_union {
|
|
Packit |
8480eb |
struct autofs_packet_hdr hdr;
|
|
Packit |
8480eb |
struct autofs_v5_packet v5_packet;
|
|
Packit |
8480eb |
autofs_packet_missing_indirect_t missing_indirect;
|
|
Packit |
8480eb |
autofs_packet_expire_indirect_t expire_indirect;
|
|
Packit |
8480eb |
autofs_packet_missing_direct_t missing_direct;
|
|
Packit |
8480eb |
autofs_packet_expire_direct_t expire_direct;
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
|
|
Packit |
8480eb |
#define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
|
|
Packit |
8480eb |
#define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
|
|
Packit |
8480eb |
#define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
|
|
Packit |
8480eb |
#define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#endif /* _LINUX_AUTO_FS4_H */
|