|
Packit |
8480eb |
/* ----------------------------------------------------------------------- *
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* mounts.h - header file for mount utilities module.
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* Copyright 2008 Red Hat, Inc. All rights reserved.
|
|
Packit |
8480eb |
* Copyright 2004-2006 Ian Kent <raven@themaw.net> - All Rights Reserved.
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* This program is free software; you can redistribute it and/or modify
|
|
Packit |
8480eb |
* it under the terms of the GNU General Public License as published by
|
|
Packit |
8480eb |
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
|
|
Packit |
8480eb |
* USA; either version 2 of the License, or (at your option) any later
|
|
Packit |
8480eb |
* version; incorporated herein by reference.
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* ----------------------------------------------------------------------- */
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#ifndef MOUNTS_H
|
|
Packit |
8480eb |
#define MOUNTS_H
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#include <linux/version.h>
|
|
Packit |
8480eb |
#include <sys/utsname.h>
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#ifndef AUTOFS_TYPE_ANY
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_ANY 0x0000
|
|
Packit |
8480eb |
#endif
|
|
Packit |
8480eb |
#ifndef AUTOFS_TYPE_INDIRECT
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_INDIRECT 0x0001
|
|
Packit |
8480eb |
#endif
|
|
Packit |
8480eb |
#ifndef AUTOFS_TYPE_DIRECT
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_DIRECT 0x0002
|
|
Packit |
8480eb |
#endif
|
|
Packit |
8480eb |
#ifndef AUTOFS_TYPE_OFFSET
|
|
Packit |
8480eb |
#define AUTOFS_TYPE_OFFSET 0x0004
|
|
Packit |
8480eb |
#endif
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#define MNTS_ALL 0x0001
|
|
Packit |
8480eb |
#define MNTS_REAL 0x0002
|
|
Packit |
8480eb |
#define MNTS_AUTOFS 0x0004
|
|
Packit Service |
97a3c9 |
#define MNTS_INDIRECT 0x0008
|
|
Packit Service |
97a3c9 |
#define MNTS_DIRECT 0x0010
|
|
Packit Service |
97a3c9 |
#define MNTS_OFFSET 0x0020
|
|
Packit Service |
6539ae |
#define MNTS_AMD_MOUNT 0x0040
|
|
Packit Service |
a945a3 |
#define MNTS_MOUNTED 0x0080
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#define REMOUNT_SUCCESS 0x0000
|
|
Packit |
8480eb |
#define REMOUNT_FAIL 0x0001
|
|
Packit |
8480eb |
#define REMOUNT_OPEN_FAIL 0x0002
|
|
Packit |
8480eb |
#define REMOUNT_STAT_FAIL 0x0004
|
|
Packit |
8480eb |
#define REMOUNT_READ_MAP 0x0008
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
extern const unsigned int t_indirect;
|
|
Packit |
8480eb |
extern const unsigned int t_direct;
|
|
Packit |
8480eb |
extern const unsigned int t_offset;
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
struct mapent;
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
struct mnt_list {
|
|
Packit Service |
1d8123 |
char *mp;
|
|
Packit Service |
97a3c9 |
unsigned int flags;
|
|
Packit Service |
85d2a3 |
|
|
Packit Service |
85d2a3 |
/* Hash of all mounts */
|
|
Packit Service |
85d2a3 |
struct hlist_node hash;
|
|
Packit Service |
85d2a3 |
unsigned int ref;
|
|
Packit Service |
85d2a3 |
|
|
Packit Service |
a945a3 |
/* List of mounts of an autofs_point */
|
|
Packit Service |
a945a3 |
struct list_head mount;
|
|
Packit Service |
6595c1 |
/* Mounted mounts list for expire */
|
|
Packit Service |
6595c1 |
struct list_head expire;
|
|
Packit Service |
a945a3 |
|
|
Packit Service |
31f869 |
/* List of sub-mounts of an autofs_point */
|
|
Packit Service |
31f869 |
struct autofs_point *ap;
|
|
Packit Service |
31f869 |
struct list_head submount;
|
|
Packit Service |
31f869 |
struct list_head submount_work;
|
|
Packit Service |
31f869 |
|
|
Packit Service |
6539ae |
/* List of amd-mounts of an autofs_point */
|
|
Packit Service |
6539ae |
char *ext_mp;
|
|
Packit Service |
6539ae |
char *amd_pref;
|
|
Packit Service |
6539ae |
char *amd_type;
|
|
Packit Service |
6539ae |
char *amd_opts;
|
|
Packit Service |
6539ae |
unsigned int amd_cache_opts;
|
|
Packit Service |
6539ae |
struct list_head amdmount;
|
|
Packit Service |
6539ae |
|
|
Packit |
8480eb |
/*
|
|
Packit |
8480eb |
* List operations ie. get_mnt_list.
|
|
Packit |
8480eb |
*/
|
|
Packit |
8480eb |
struct mnt_list *next;
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
struct nfs_mount_vers {
|
|
Packit |
8480eb |
unsigned int major;
|
|
Packit |
8480eb |
unsigned int minor;
|
|
Packit |
8480eb |
unsigned int fix;
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
unsigned int linux_version_code(void);
|
|
Packit |
8480eb |
int check_nfs_mount_version(struct nfs_mount_vers *, struct nfs_mount_vers *);
|
|
Packit |
8480eb |
extern unsigned int nfs_mount_uses_string_options;
|
|
Packit |
8480eb |
|
|
Packit Service |
718b04 |
int mount_fullpath(char *fullpath, size_t max_len,
|
|
Packit Service |
718b04 |
const char *root, const char *name);
|
|
Packit Service |
718b04 |
|
|
Packit |
8480eb |
struct amd_entry;
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
struct substvar *addstdenv(struct substvar *sv, const char *prefix);
|
|
Packit |
8480eb |
struct substvar *removestdenv(struct substvar *sv, const char *prefix);
|
|
Packit |
8480eb |
void add_std_amd_vars(struct substvar *sv);
|
|
Packit |
8480eb |
void remove_std_amd_vars(void);
|
|
Packit |
8480eb |
struct amd_entry *new_amd_entry(const struct substvar *sv);
|
|
Packit |
8480eb |
void clear_amd_entry(struct amd_entry *entry);
|
|
Packit |
8480eb |
void free_amd_entry(struct amd_entry *entry);
|
|
Packit |
8480eb |
void free_amd_entry_list(struct list_head *entries);
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
unsigned int query_kproto_ver(void);
|
|
Packit |
8480eb |
unsigned int get_kver_major(void);
|
|
Packit |
8480eb |
unsigned int get_kver_minor(void);
|
|
Packit Service |
e46cf1 |
char *make_options_string(char *path, int pipefd,
|
|
Packit Service |
e46cf1 |
const char *type, unsigned int flags);
|
|
Packit |
8480eb |
char *make_mnt_name_string(char *path);
|
|
Packit Service |
088ae4 |
int ext_mount_add(const char *, const char *);
|
|
Packit Service |
088ae4 |
int ext_mount_remove(const char *);
|
|
Packit |
8480eb |
int ext_mount_inuse(const char *);
|
|
Packit Service |
85d2a3 |
struct mnt_list *mnts_lookup_mount(const char *mp);
|
|
Packit Service |
85d2a3 |
void mnts_put_mount(struct mnt_list *mnt);
|
|
Packit Service |
31f869 |
struct mnt_list *mnts_find_submount(const char *path);
|
|
Packit Service |
31f869 |
struct mnt_list *mnts_add_submount(struct autofs_point *ap);
|
|
Packit Service |
31f869 |
void mnts_remove_submount(const char *mp);
|
|
Packit Service |
6539ae |
struct mnt_list *mnts_find_amdmount(const char *path);
|
|
Packit Service |
6539ae |
struct mnt_list *mnts_add_amdmount(struct autofs_point *ap, struct amd_entry *entry);
|
|
Packit Service |
6539ae |
void mnts_remove_amdmount(const char *mp);
|
|
Packit Service |
a945a3 |
struct mnt_list *mnts_add_mount(struct autofs_point *ap, const char *name, unsigned int flags);
|
|
Packit Service |
a945a3 |
void mnts_remove_mount(const char *mp, unsigned int flags);
|
|
Packit Service |
4213a1 |
struct mnt_list *get_mnt_list(const char *path, int include);
|
|
Packit Service |
d17eec |
unsigned int mnts_has_mounted_mounts(struct autofs_point *ap);
|
|
Packit Service |
a945a3 |
void mnts_get_expire_list(struct list_head *mnts, struct autofs_point *ap);
|
|
Packit Service |
a945a3 |
void mnts_put_expire_list(struct list_head *mnts);
|
|
Packit Service |
a945a3 |
void mnts_set_mounted_mount(struct autofs_point *ap, const char *name);
|
|
Packit Service |
d5561f |
int unlink_mount_tree(struct autofs_point *ap, const char *mp);
|
|
Packit |
8480eb |
void free_mnt_list(struct mnt_list *list);
|
|
Packit Service |
4213a1 |
int is_mounted(const char *mp, unsigned int type);
|
|
Packit |
8480eb |
void set_tsd_user_vars(unsigned int, uid_t, gid_t);
|
|
Packit |
8480eb |
const char *mount_type_str(unsigned int);
|
|
Packit |
8480eb |
void set_exp_timeout(struct autofs_point *ap, struct map_source *source, time_t timeout);
|
|
Packit |
8480eb |
time_t get_exp_timeout(struct autofs_point *ap, struct map_source *source);
|
|
Packit |
8480eb |
void notify_mount_result(struct autofs_point *, const char *, time_t, const char *);
|
|
Packit |
8480eb |
int try_remount(struct autofs_point *, struct mapent *, unsigned int);
|
|
Packit |
8480eb |
void set_indirect_mount_tree_catatonic(struct autofs_point *);
|
|
Packit |
8480eb |
void set_direct_mount_tree_catatonic(struct autofs_point *, struct mapent *);
|
|
Packit |
8480eb |
int umount_ent(struct autofs_point *, const char *);
|
|
Packit Service |
088ae4 |
int umount_amd_ext_mount(struct autofs_point *, const char *);
|
|
Packit |
8480eb |
int mount_multi_triggers(struct autofs_point *, struct mapent *, const char *, unsigned int, const char *);
|
|
Packit |
8480eb |
int umount_multi_triggers(struct autofs_point *, struct mapent *, char *, const char *);
|
|
Packit |
8480eb |
int clean_stale_multi_triggers(struct autofs_point *, struct mapent *, char *, const char *);
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#endif
|