aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4/inode.c')
-rw-r--r--fs/autofs4/inode.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index a3ae0b2aeb5a..61b21051bd5a 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -1,15 +1,11 @@
1/* -*- c -*- --------------------------------------------------------------- * 1/*
2 * 2 * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
3 * linux/fs/autofs/inode.c 3 * Copyright 2005-2006 Ian Kent <raven@themaw.net>
4 *
5 * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
6 * Copyright 2005-2006 Ian Kent <raven@themaw.net>
7 * 4 *
8 * This file is part of the Linux kernel and is made available under 5 * This file is part of the Linux kernel and is made available under
9 * the terms of the GNU General Public License, version 2, or at your 6 * the terms of the GNU General Public License, version 2, or at your
10 * option, any later version, incorporated herein by reference. 7 * option, any later version, incorporated herein by reference.
11 * 8 */
12 * ------------------------------------------------------------------------- */
13 9
14#include <linux/kernel.h> 10#include <linux/kernel.h>
15#include <linux/slab.h> 11#include <linux/slab.h>
@@ -24,7 +20,9 @@
24 20
25struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi) 21struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi)
26{ 22{
27 struct autofs_info *ino = kzalloc(sizeof(*ino), GFP_KERNEL); 23 struct autofs_info *ino;
24
25 ino = kzalloc(sizeof(*ino), GFP_KERNEL);
28 if (ino) { 26 if (ino) {
29 INIT_LIST_HEAD(&ino->active); 27 INIT_LIST_HEAD(&ino->active);
30 INIT_LIST_HEAD(&ino->expiring); 28 INIT_LIST_HEAD(&ino->expiring);
@@ -62,7 +60,7 @@ void autofs4_kill_sb(struct super_block *sb)
62 put_pid(sbi->oz_pgrp); 60 put_pid(sbi->oz_pgrp);
63 } 61 }
64 62
65 DPRINTK("shutting down"); 63 pr_debug("shutting down\n");
66 kill_litter_super(sb); 64 kill_litter_super(sb);
67 if (sbi) 65 if (sbi)
68 kfree_rcu(sbi, rcu); 66 kfree_rcu(sbi, rcu);
@@ -94,7 +92,12 @@ static int autofs4_show_options(struct seq_file *m, struct dentry *root)
94 seq_printf(m, ",direct"); 92 seq_printf(m, ",direct");
95 else 93 else
96 seq_printf(m, ",indirect"); 94 seq_printf(m, ",indirect");
97 95#ifdef CONFIG_CHECKPOINT_RESTORE
96 if (sbi->pipe)
97 seq_printf(m, ",pipe_ino=%ld", sbi->pipe->f_inode->i_ino);
98 else
99 seq_printf(m, ",pipe_ino=-1");
100#endif
98 return 0; 101 return 0;
99} 102}
100 103
@@ -147,6 +150,7 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid,
147 150
148 while ((p = strsep(&options, ",")) != NULL) { 151 while ((p = strsep(&options, ",")) != NULL) {
149 int token; 152 int token;
153
150 if (!*p) 154 if (!*p)
151 continue; 155 continue;
152 156
@@ -204,9 +208,9 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid,
204 208
205int autofs4_fill_super(struct super_block *s, void *data, int silent) 209int autofs4_fill_super(struct super_block *s, void *data, int silent)
206{ 210{
207 struct inode * root_inode; 211 struct inode *root_inode;
208 struct dentry * root; 212 struct dentry *root;
209 struct file * pipe; 213 struct file *pipe;
210 int pipefd; 214 int pipefd;
211 struct autofs_sb_info *sbi; 215 struct autofs_sb_info *sbi;
212 struct autofs_info *ino; 216 struct autofs_info *ino;
@@ -217,7 +221,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
217 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 221 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
218 if (!sbi) 222 if (!sbi)
219 return -ENOMEM; 223 return -ENOMEM;
220 DPRINTK("starting up, sbi = %p",sbi); 224 pr_debug("starting up, sbi = %p\n", sbi);
221 225
222 s->s_fs_info = sbi; 226 s->s_fs_info = sbi;
223 sbi->magic = AUTOFS_SBI_MAGIC; 227 sbi->magic = AUTOFS_SBI_MAGIC;
@@ -266,14 +270,14 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
266 if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid, 270 if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
267 &pgrp, &pgrp_set, &sbi->type, &sbi->min_proto, 271 &pgrp, &pgrp_set, &sbi->type, &sbi->min_proto,
268 &sbi->max_proto)) { 272 &sbi->max_proto)) {
269 printk("autofs: called with bogus options\n"); 273 pr_err("called with bogus options\n");
270 goto fail_dput; 274 goto fail_dput;
271 } 275 }
272 276
273 if (pgrp_set) { 277 if (pgrp_set) {
274 sbi->oz_pgrp = find_get_pid(pgrp); 278 sbi->oz_pgrp = find_get_pid(pgrp);
275 if (!sbi->oz_pgrp) { 279 if (!sbi->oz_pgrp) {
276 pr_warn("autofs: could not find process group %d\n", 280 pr_err("could not find process group %d\n",
277 pgrp); 281 pgrp);
278 goto fail_dput; 282 goto fail_dput;
279 } 283 }
@@ -290,10 +294,10 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
290 /* Couldn't this be tested earlier? */ 294 /* Couldn't this be tested earlier? */
291 if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION || 295 if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION ||
292 sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) { 296 sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) {
293 printk("autofs: kernel does not match daemon version " 297 pr_err("kernel does not match daemon version "
294 "daemon (%d, %d) kernel (%d, %d)\n", 298 "daemon (%d, %d) kernel (%d, %d)\n",
295 sbi->min_proto, sbi->max_proto, 299 sbi->min_proto, sbi->max_proto,
296 AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION); 300 AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION);
297 goto fail_dput; 301 goto fail_dput;
298 } 302 }
299 303
@@ -304,11 +308,11 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
304 sbi->version = sbi->max_proto; 308 sbi->version = sbi->max_proto;
305 sbi->sub_version = AUTOFS_PROTO_SUBVERSION; 309 sbi->sub_version = AUTOFS_PROTO_SUBVERSION;
306 310
307 DPRINTK("pipe fd = %d, pgrp = %u", pipefd, pid_nr(sbi->oz_pgrp)); 311 pr_debug("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp));
308 pipe = fget(pipefd); 312 pipe = fget(pipefd);
309 313
310 if (!pipe) { 314 if (!pipe) {
311 printk("autofs: could not open pipe file descriptor\n"); 315 pr_err("could not open pipe file descriptor\n");
312 goto fail_dput; 316 goto fail_dput;
313 } 317 }
314 ret = autofs_prepare_pipe(pipe); 318 ret = autofs_prepare_pipe(pipe);
@@ -323,12 +327,12 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
323 */ 327 */
324 s->s_root = root; 328 s->s_root = root;
325 return 0; 329 return 0;
326 330
327 /* 331 /*
328 * Failure ... clean up. 332 * Failure ... clean up.
329 */ 333 */
330fail_fput: 334fail_fput:
331 printk("autofs: pipe file descriptor does not contain proper ops\n"); 335 pr_err("pipe file descriptor does not contain proper ops\n");
332 fput(pipe); 336 fput(pipe);
333 /* fall through */ 337 /* fall through */
334fail_dput: 338fail_dput: