Lines Matching full:sbi
12 struct autofs_info *autofs_new_ino(struct autofs_sb_info *sbi) in autofs_new_ino() argument
21 ino->sbi = sbi; in autofs_new_ino()
43 struct autofs_sb_info *sbi = autofs_sbi(sb); in autofs_kill_sb() local
51 if (sbi) { in autofs_kill_sb()
53 autofs_catatonic_mode(sbi); in autofs_kill_sb()
54 put_pid(sbi->oz_pgrp); in autofs_kill_sb()
59 if (sbi) in autofs_kill_sb()
60 kfree_rcu(sbi, rcu); in autofs_kill_sb()
65 struct autofs_sb_info *sbi = autofs_sbi(root->d_sb); in autofs_show_options() local
68 if (!sbi) in autofs_show_options()
71 seq_printf(m, ",fd=%d", sbi->pipefd); in autofs_show_options()
78 seq_printf(m, ",pgrp=%d", pid_vnr(sbi->oz_pgrp)); in autofs_show_options()
79 seq_printf(m, ",timeout=%lu", sbi->exp_timeout/HZ); in autofs_show_options()
80 seq_printf(m, ",minproto=%d", sbi->min_proto); in autofs_show_options()
81 seq_printf(m, ",maxproto=%d", sbi->max_proto); in autofs_show_options()
83 if (autofs_type_offset(sbi->type)) in autofs_show_options()
85 else if (autofs_type_direct(sbi->type)) in autofs_show_options()
89 if (sbi->flags & AUTOFS_SBI_STRICTEXPIRE) in autofs_show_options()
91 if (sbi->flags & AUTOFS_SBI_IGNORE) in autofs_show_options()
94 if (sbi->pipe) in autofs_show_options()
95 seq_printf(m, ",pipe_ino=%ld", file_inode(sbi->pipe)->i_ino); in autofs_show_options()
155 static int autofs_parse_fd(struct fs_context *fc, struct autofs_sb_info *sbi, in autofs_parse_fd() argument
183 if (sbi->pipe) in autofs_parse_fd()
184 fput(sbi->pipe); in autofs_parse_fd()
186 sbi->pipefd = result->uint_32; in autofs_parse_fd()
187 sbi->pipe = pipe; in autofs_parse_fd()
195 struct autofs_sb_info *sbi = fc->s_fs_info; in autofs_parse_param() local
205 return autofs_parse_fd(fc, sbi, param, &result); in autofs_parse_param()
217 sbi->min_proto = result.uint_32; in autofs_parse_param()
220 sbi->max_proto = result.uint_32; in autofs_parse_param()
223 set_autofs_type_indirect(&sbi->type); in autofs_parse_param()
226 set_autofs_type_direct(&sbi->type); in autofs_parse_param()
229 set_autofs_type_offset(&sbi->type); in autofs_parse_param()
232 sbi->flags |= AUTOFS_SBI_STRICTEXPIRE; in autofs_parse_param()
235 sbi->flags |= AUTOFS_SBI_IGNORE; in autofs_parse_param()
243 struct autofs_sb_info *sbi; in autofs_alloc_sbi() local
245 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in autofs_alloc_sbi()
246 if (!sbi) in autofs_alloc_sbi()
249 sbi->magic = AUTOFS_SBI_MAGIC; in autofs_alloc_sbi()
250 sbi->flags = AUTOFS_SBI_CATATONIC; in autofs_alloc_sbi()
251 sbi->min_proto = AUTOFS_MIN_PROTO_VERSION; in autofs_alloc_sbi()
252 sbi->max_proto = AUTOFS_MAX_PROTO_VERSION; in autofs_alloc_sbi()
253 sbi->pipefd = -1; in autofs_alloc_sbi()
255 set_autofs_type_indirect(&sbi->type); in autofs_alloc_sbi()
256 mutex_init(&sbi->wq_mutex); in autofs_alloc_sbi()
257 mutex_init(&sbi->pipe_mutex); in autofs_alloc_sbi()
258 spin_lock_init(&sbi->fs_lock); in autofs_alloc_sbi()
259 spin_lock_init(&sbi->lookup_lock); in autofs_alloc_sbi()
260 INIT_LIST_HEAD(&sbi->active_list); in autofs_alloc_sbi()
261 INIT_LIST_HEAD(&sbi->expiring_list); in autofs_alloc_sbi()
263 return sbi; in autofs_alloc_sbi()
268 struct autofs_sb_info *sbi = fc->s_fs_info; in autofs_validate_protocol() local
271 if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION || in autofs_validate_protocol()
272 sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) { in autofs_validate_protocol()
275 sbi->min_proto, sbi->max_proto, in autofs_validate_protocol()
281 if (sbi->max_proto > AUTOFS_MAX_PROTO_VERSION) in autofs_validate_protocol()
282 sbi->version = AUTOFS_MAX_PROTO_VERSION; in autofs_validate_protocol()
284 sbi->version = sbi->max_proto; in autofs_validate_protocol()
286 switch (sbi->version) { in autofs_validate_protocol()
288 sbi->sub_version = 7; in autofs_validate_protocol()
291 sbi->sub_version = AUTOFS_PROTO_SUBVERSION; in autofs_validate_protocol()
294 sbi->sub_version = 0; in autofs_validate_protocol()
303 struct autofs_sb_info *sbi = s->s_fs_info; in autofs_fill_super() local
307 pr_debug("starting up, sbi = %p\n", sbi); in autofs_fill_super()
309 sbi->sb = s; in autofs_fill_super()
320 ino = autofs_new_ino(sbi); in autofs_fill_super()
341 sbi->oz_pgrp = find_get_pid(ctx->pgrp); in autofs_fill_super()
342 if (!sbi->oz_pgrp) in autofs_fill_super()
346 sbi->oz_pgrp = get_task_pid(current, PIDTYPE_PGID); in autofs_fill_super()
348 if (autofs_type_trigger(sbi->type)) in autofs_fill_super()
356 sbi->pipefd, pid_nr(sbi->oz_pgrp)); in autofs_fill_super()
358 sbi->flags &= ~AUTOFS_SBI_CATATONIC; in autofs_fill_super()
367 struct autofs_sb_info *sbi = fc->s_fs_info; in autofs_get_tree() local
374 if (sbi->pipefd < 0) in autofs_get_tree()
383 struct autofs_sb_info *sbi = fc->s_fs_info; in autofs_free_fc() local
385 if (sbi) { in autofs_free_fc()
386 if (sbi->pipe) in autofs_free_fc()
387 fput(sbi->pipe); in autofs_free_fc()
388 kfree(sbi); in autofs_free_fc()
405 struct autofs_sb_info *sbi; in autofs_init_fs_context() local
414 sbi = autofs_alloc_sbi(); in autofs_init_fs_context()
415 if (!sbi) in autofs_init_fs_context()
419 fc->s_fs_info = sbi; in autofs_init_fs_context()