hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/fs/autofs/autofs_i.h
....@@ -1,10 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved
34 * Copyright 2005-2006 Ian Kent <raven@themaw.net>
4
- *
5
- * This file is part of the Linux kernel and is made available under
6
- * the terms of the GNU General Public License, version 2, or at your
7
- * option, any later version, incorporated herein by reference.
85 */
96
107 /* Internal header file for autofs */
....@@ -42,6 +39,8 @@
4239 #endif
4340 #define pr_fmt(fmt) KBUILD_MODNAME ":pid:%d:%s: " fmt, current->pid, __func__
4441
42
+extern struct file_system_type autofs_fs_type;
43
+
4544 /*
4645 * Unified info structure. This is pointed to by both the dentry and
4746 * inode structures. Each file in the filesystem has an instance of this
....@@ -59,16 +58,16 @@
5958 struct completion expire_complete;
6059
6160 struct list_head active;
62
- int active_count;
6361
6462 struct list_head expiring;
6563
6664 struct autofs_sb_info *sbi;
6765 unsigned long last_used;
68
- atomic_t count;
66
+ int count;
6967
7068 kuid_t uid;
7169 kgid_t gid;
70
+ struct rcu_head rcu;
7271 };
7372
7473 #define AUTOFS_INF_EXPIRING (1<<0) /* dentry in the process of expiring */
....@@ -101,16 +100,20 @@
101100
102101 #define AUTOFS_SBI_MAGIC 0x6d4a556d
103102
103
+#define AUTOFS_SBI_CATATONIC 0x0001
104
+#define AUTOFS_SBI_STRICTEXPIRE 0x0002
105
+#define AUTOFS_SBI_IGNORE 0x0004
106
+
104107 struct autofs_sb_info {
105108 u32 magic;
106109 int pipefd;
107110 struct file *pipe;
108111 struct pid *oz_pgrp;
109
- int catatonic;
110112 int version;
111113 int sub_version;
112114 int min_proto;
113115 int max_proto;
116
+ unsigned int flags;
114117 unsigned long exp_timeout;
115118 unsigned int type;
116119 struct super_block *sb;
....@@ -126,8 +129,7 @@
126129
127130 static inline struct autofs_sb_info *autofs_sbi(struct super_block *sb)
128131 {
129
- return sb->s_magic != AUTOFS_SUPER_MAGIC ?
130
- NULL : (struct autofs_sb_info *)(sb->s_fs_info);
132
+ return (struct autofs_sb_info *)(sb->s_fs_info);
131133 }
132134
133135 static inline struct autofs_info *autofs_dentry_ino(struct dentry *dentry)
....@@ -141,7 +143,8 @@
141143 */
142144 static inline int autofs_oz_mode(struct autofs_sb_info *sbi)
143145 {
144
- return sbi->catatonic || task_pgrp(current) == sbi->oz_pgrp;
146
+ return ((sbi->flags & AUTOFS_SBI_CATATONIC) ||
147
+ task_pgrp(current) == sbi->oz_pgrp);
145148 }
146149
147150 struct inode *autofs_get_inode(struct super_block *, umode_t);
....@@ -210,6 +213,8 @@
210213 return -EINVAL;
211214 /* We want a packet pipe */
212215 pipe->f_flags |= O_DIRECT;
216
+ /* We don't expect -EAGAIN */
217
+ pipe->f_flags &= ~O_NONBLOCK;
213218 return 0;
214219 }
215220