aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/autofs_i.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4/autofs_i.h')
-rw-r--r--fs/autofs4/autofs_i.h54
1 files changed, 35 insertions, 19 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index f54c5b21f876..57c4903614e5 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -3,6 +3,7 @@
3 * linux/fs/autofs/autofs_i.h 3 * linux/fs/autofs/autofs_i.h
4 * 4 *
5 * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved 5 * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved
6 * Copyright 2005-2006 Ian Kent <raven@themaw.net>
6 * 7 *
7 * This file is part of the Linux kernel and is made available under 8 * 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 * the terms of the GNU General Public License, version 2, or at your
@@ -41,14 +42,6 @@
41 42
42#define AUTOFS_SUPER_MAGIC 0x0187 43#define AUTOFS_SUPER_MAGIC 0x0187
43 44
44/*
45 * If the daemon returns a negative response (AUTOFS_IOC_FAIL) then the
46 * kernel will keep the negative response cached for up to the time given
47 * here, although the time can be shorter if the kernel throws the dcache
48 * entry away. This probably should be settable from user space.
49 */
50#define AUTOFS_NEGATIVE_TIMEOUT (60*HZ) /* 1 minute */
51
52/* Unified info structure. This is pointed to by both the dentry and 45/* Unified info structure. This is pointed to by both the dentry and
53 inode structures. Each file in the filesystem has an instance of this 46 inode structures. Each file in the filesystem has an instance of this
54 structure. It holds a reference to the dentry, so dentries are never 47 structure. It holds a reference to the dentry, so dentries are never
@@ -63,6 +56,7 @@ struct autofs_info {
63 56
64 struct autofs_sb_info *sbi; 57 struct autofs_sb_info *sbi;
65 unsigned long last_used; 58 unsigned long last_used;
59 atomic_t count;
66 60
67 mode_t mode; 61 mode_t mode;
68 size_t size; 62 size_t size;
@@ -83,23 +77,37 @@ struct autofs_wait_queue {
83 int hash; 77 int hash;
84 int len; 78 int len;
85 char *name; 79 char *name;
80 u32 dev;
81 u64 ino;
82 uid_t uid;
83 gid_t gid;
84 pid_t pid;
85 pid_t tgid;
86 /* This is for status reporting upon return */ 86 /* This is for status reporting upon return */
87 int status; 87 int status;
88 atomic_t notified; 88 atomic_t notify;
89 atomic_t wait_ctr; 89 atomic_t wait_ctr;
90}; 90};
91 91
92#define AUTOFS_SBI_MAGIC 0x6d4a556d 92#define AUTOFS_SBI_MAGIC 0x6d4a556d
93 93
94#define AUTOFS_TYPE_INDIRECT 0x0001
95#define AUTOFS_TYPE_DIRECT 0x0002
96#define AUTOFS_TYPE_OFFSET 0x0004
97
94struct autofs_sb_info { 98struct autofs_sb_info {
95 u32 magic; 99 u32 magic;
96 struct dentry *root; 100 struct dentry *root;
101 int pipefd;
97 struct file *pipe; 102 struct file *pipe;
98 pid_t oz_pgrp; 103 pid_t oz_pgrp;
99 int catatonic; 104 int catatonic;
100 int version; 105 int version;
101 int sub_version; 106 int sub_version;
107 int min_proto;
108 int max_proto;
102 unsigned long exp_timeout; 109 unsigned long exp_timeout;
110 unsigned int type;
103 int reghost_enabled; 111 int reghost_enabled;
104 int needs_reghost; 112 int needs_reghost;
105 struct super_block *sb; 113 struct super_block *sb;
@@ -166,8 +174,10 @@ int autofs4_expire_multi(struct super_block *, struct vfsmount *,
166extern struct inode_operations autofs4_symlink_inode_operations; 174extern struct inode_operations autofs4_symlink_inode_operations;
167extern struct inode_operations autofs4_dir_inode_operations; 175extern struct inode_operations autofs4_dir_inode_operations;
168extern struct inode_operations autofs4_root_inode_operations; 176extern struct inode_operations autofs4_root_inode_operations;
169extern struct file_operations autofs4_dir_operations; 177extern struct inode_operations autofs4_indirect_root_inode_operations;
170extern struct file_operations autofs4_root_operations; 178extern struct inode_operations autofs4_direct_root_inode_operations;
179extern const struct file_operations autofs4_dir_operations;
180extern const struct file_operations autofs4_root_operations;
171 181
172/* Initializing function */ 182/* Initializing function */
173 183
@@ -176,13 +186,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info
176 186
177/* Queue management functions */ 187/* Queue management functions */
178 188
179enum autofs_notify
180{
181 NFY_NONE,
182 NFY_MOUNT,
183 NFY_EXPIRE
184};
185
186int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify); 189int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify);
187int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); 190int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int);
188void autofs4_catatonic_mode(struct autofs_sb_info *); 191void autofs4_catatonic_mode(struct autofs_sb_info *);
@@ -200,12 +203,22 @@ static inline int autofs4_follow_mount(struct vfsmount **mnt, struct dentry **de
200 return res; 203 return res;
201} 204}
202 205
206static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi)
207{
208 return new_encode_dev(sbi->sb->s_dev);
209}
210
211static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
212{
213 return sbi->sb->s_root->d_inode->i_ino;
214}
215
203static inline int simple_positive(struct dentry *dentry) 216static inline int simple_positive(struct dentry *dentry)
204{ 217{
205 return dentry->d_inode && !d_unhashed(dentry); 218 return dentry->d_inode && !d_unhashed(dentry);
206} 219}
207 220
208static inline int simple_empty_nolock(struct dentry *dentry) 221static inline int __simple_empty(struct dentry *dentry)
209{ 222{
210 struct dentry *child; 223 struct dentry *child;
211 int ret = 0; 224 int ret = 0;
@@ -217,3 +230,6 @@ static inline int simple_empty_nolock(struct dentry *dentry)
217out: 230out:
218 return ret; 231 return ret;
219} 232}
233
234void autofs4_dentry_release(struct dentry *);
235