Home | History | Annotate | Line # | Download | only in autofs
      1      1.1  christos /*	$NetBSD: autofs_linux.h,v 1.1.1.3 2015/01/17 16:34:16 christos Exp $	*/
      2      1.1  christos 
      3      1.1  christos /*
      4      1.1  christos  * Copyright (c) 1999-2003 Ion Badulescu
      5  1.1.1.3  christos  * Copyright (c) 1997-2014 Erez Zadok
      6      1.1  christos  * Copyright (c) 1990 Jan-Simon Pendry
      7      1.1  christos  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
      8      1.1  christos  * Copyright (c) 1990 The Regents of the University of California.
      9      1.1  christos  * All rights reserved.
     10      1.1  christos  *
     11      1.1  christos  * This code is derived from software contributed to Berkeley by
     12      1.1  christos  * Jan-Simon Pendry at Imperial College, London.
     13      1.1  christos  *
     14      1.1  christos  * Redistribution and use in source and binary forms, with or without
     15      1.1  christos  * modification, are permitted provided that the following conditions
     16      1.1  christos  * are met:
     17      1.1  christos  * 1. Redistributions of source code must retain the above copyright
     18      1.1  christos  *    notice, this list of conditions and the following disclaimer.
     19      1.1  christos  * 2. Redistributions in binary form must reproduce the above copyright
     20      1.1  christos  *    notice, this list of conditions and the following disclaimer in the
     21      1.1  christos  *    documentation and/or other materials provided with the distribution.
     22  1.1.1.3  christos  * 3. Neither the name of the University nor the names of its contributors
     23      1.1  christos  *    may be used to endorse or promote products derived from this software
     24      1.1  christos  *    without specific prior written permission.
     25      1.1  christos  *
     26      1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     27      1.1  christos  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28      1.1  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29      1.1  christos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     30      1.1  christos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31      1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32      1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33      1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34      1.1  christos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35      1.1  christos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36      1.1  christos  * SUCH DAMAGE.
     37      1.1  christos  *
     38      1.1  christos  *
     39      1.1  christos  * File: am-utils/conf/autofs/autofs_linux.h
     40      1.1  christos  *
     41      1.1  christos  */
     42      1.1  christos 
     43      1.1  christos /*
     44      1.1  christos  * Automounter filesystem headers for Linux
     45      1.1  christos  */
     46      1.1  christos 
     47      1.1  christos #if !defined(HAVE_LINUX_AUTO_FS_H) && !defined(HAVE_LINUX_AUTO_FS4_H)
     48      1.1  christos /* We didn't find the headers, so we can't compile in the autofs support */
     49      1.1  christos # undef HAVE_FS_AUTOFS
     50      1.1  christos # undef MNTTAB_TYPE_AUTOFS
     51      1.1  christos #endif /* !HAVE_LINUX_AUTO_FS_H && !HAVE_LINUX_AUTO_FS4_H */
     52      1.1  christos 
     53      1.1  christos #ifdef HAVE_FS_AUTOFS
     54      1.1  christos 
     55      1.1  christos struct autofs_pending_mount {
     56      1.1  christos   unsigned long wait_queue_token;	/* Associated kernel wait token */
     57      1.1  christos   char *name;
     58      1.1  christos   struct autofs_pending_mount *next;
     59      1.1  christos };
     60      1.1  christos 
     61      1.1  christos struct autofs_pending_umount {
     62      1.1  christos   unsigned long wait_queue_token;	/* Associated kernel wait token */
     63      1.1  christos   char *name;
     64      1.1  christos   struct autofs_pending_umount *next;
     65      1.1  christos };
     66      1.1  christos 
     67      1.1  christos typedef struct {
     68      1.1  christos   int fd;
     69      1.1  christos   int kernelfd;
     70      1.1  christos   int ioctlfd;
     71      1.1  christos   int version;
     72      1.1  christos   struct autofs_pending_mount *pending_mounts;
     73      1.1  christos   struct autofs_pending_umount *pending_umounts;
     74      1.1  christos } autofs_fh_t;
     75      1.1  christos 
     76      1.1  christos #ifndef HAVE_LINUX_AUTO_FS4_H
     77      1.1  christos union autofs_packet_union {
     78      1.1  christos 	struct autofs_packet_hdr hdr;
     79      1.1  christos 	struct autofs_packet_missing missing;
     80      1.1  christos 	struct autofs_packet_expire expire;
     81      1.1  christos };
     82  1.1.1.3  christos 
     83  1.1.1.3  christos /* typedef unsigned long autofs_wqt_t; */
     84      1.1  christos #endif /* not HAVE_LINUX_AUTO_FS4_H */
     85      1.1  christos 
     86      1.1  christos #define AUTOFS_AUTO_FS_FLAGS	(FS_AMQINFO | FS_DIRECTORY | FS_AUTOFS | FS_ON_AUTOFS)
     87      1.1  christos #define AUTOFS_DIRECT_FS_FLAGS	(FS_DIRECT | FS_MKMNT | FS_NOTIMEOUT | FS_BACKGROUND | FS_AMQINFO)
     88      1.1  christos #define AUTOFS_ERROR_FS_FLAGS	(FS_DISCARD)
     89      1.1  christos #define AUTOFS_HOST_FS_FLAGS	(FS_MKMNT | FS_BACKGROUND | FS_AMQINFO)
     90      1.1  christos #define AUTOFS_LINK_FS_FLAGS	(FS_MBACKGROUND)
     91      1.1  christos #define AUTOFS_LINKX_FS_FLAGS	(FS_MBACKGROUND)
     92      1.1  christos #define AUTOFS_NFSL_FS_FLAGS	(FS_BACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
     93      1.1  christos #define AUTOFS_NFSX_FS_FLAGS	(/* FS_UBACKGROUND| */ FS_AMQINFO )
     94      1.1  christos #define AUTOFS_PROGRAM_FS_FLAGS	(FS_BACKGROUND | FS_AMQINFO)
     95      1.1  christos #define AUTOFS_ROOT_FS_FLAGS	(FS_NOTIMEOUT | FS_AMQINFO | FS_DIRECTORY)
     96      1.1  christos #define AUTOFS_TOPLVL_FS_FLAGS	(FS_MKMNT | FS_NOTIMEOUT | FS_BACKGROUND | FS_AMQINFO | FS_DIRECTORY | FS_AUTOFS)
     97      1.1  christos #define AUTOFS_UNION_FS_FLAGS	(FS_NOTIMEOUT | FS_BACKGROUND | FS_AMQINFO | FS_DIRECTORY | FS_ON_AUTOFS)
     98      1.1  christos 
     99      1.1  christos #define AUTOFS_CACHEFS_FS_FLAGS	(FS_NOTIMEOUT | FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    100      1.1  christos #define AUTOFS_CDFS_FS_FLAGS	(FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    101  1.1.1.2  christos #define AUTOFS_UDF_FS_FLAGS	(FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    102  1.1.1.3  christos #define AUTOFS_LUSTRE_FS_FLAGS	(FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    103      1.1  christos #define AUTOFS_EFS_FS_FLAGS	(FS_NOTIMEOUT | FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    104      1.1  christos #define AUTOFS_LOFS_FS_FLAGS	(FS_NOTIMEOUT | FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    105      1.1  christos #define AUTOFS_NFS_FS_FLAGS	(FS_BACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    106      1.1  christos #define AUTOFS_PCFS_FS_FLAGS	(FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    107      1.1  christos #define AUTOFS_UFS_FS_FLAGS	(FS_NOTIMEOUT | FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    108      1.1  christos #define AUTOFS_XFS_FS_FLAGS	(FS_NOTIMEOUT | FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    109  1.1.1.3  christos #define AUTOFS_EXT_FS_FLAGS	(FS_NOTIMEOUT | FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    110      1.1  christos #define AUTOFS_TMPFS_FS_FLAGS	(FS_NOTIMEOUT | FS_UBACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
    111      1.1  christos #endif /* HAVE_FS_AUTOFS */
    112