diff options
Diffstat (limited to 'fs/autofs4/inode.c')
-rw-r--r-- | fs/autofs4/inode.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index c7e65bb30ba0..716e12b627b2 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -197,9 +197,9 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) | |||
197 | seq_printf(m, ",minproto=%d", sbi->min_proto); | 197 | seq_printf(m, ",minproto=%d", sbi->min_proto); |
198 | seq_printf(m, ",maxproto=%d", sbi->max_proto); | 198 | seq_printf(m, ",maxproto=%d", sbi->max_proto); |
199 | 199 | ||
200 | if (sbi->type & AUTOFS_TYPE_OFFSET) | 200 | if (autofs_type_offset(sbi->type)) |
201 | seq_printf(m, ",offset"); | 201 | seq_printf(m, ",offset"); |
202 | else if (sbi->type & AUTOFS_TYPE_DIRECT) | 202 | else if (autofs_type_direct(sbi->type)) |
203 | seq_printf(m, ",direct"); | 203 | seq_printf(m, ",direct"); |
204 | else | 204 | else |
205 | seq_printf(m, ",indirect"); | 205 | seq_printf(m, ",indirect"); |
@@ -235,8 +235,8 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, | |||
235 | substring_t args[MAX_OPT_ARGS]; | 235 | substring_t args[MAX_OPT_ARGS]; |
236 | int option; | 236 | int option; |
237 | 237 | ||
238 | *uid = current->uid; | 238 | *uid = current_uid(); |
239 | *gid = current->gid; | 239 | *gid = current_gid(); |
240 | *pgrp = task_pgrp_nr(current); | 240 | *pgrp = task_pgrp_nr(current); |
241 | 241 | ||
242 | *minproto = AUTOFS_MIN_PROTO_VERSION; | 242 | *minproto = AUTOFS_MIN_PROTO_VERSION; |
@@ -284,13 +284,13 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, | |||
284 | *maxproto = option; | 284 | *maxproto = option; |
285 | break; | 285 | break; |
286 | case Opt_indirect: | 286 | case Opt_indirect: |
287 | *type = AUTOFS_TYPE_INDIRECT; | 287 | set_autofs_type_indirect(type); |
288 | break; | 288 | break; |
289 | case Opt_direct: | 289 | case Opt_direct: |
290 | *type = AUTOFS_TYPE_DIRECT; | 290 | set_autofs_type_direct(type); |
291 | break; | 291 | break; |
292 | case Opt_offset: | 292 | case Opt_offset: |
293 | *type = AUTOFS_TYPE_OFFSET; | 293 | set_autofs_type_offset(type); |
294 | break; | 294 | break; |
295 | default: | 295 | default: |
296 | return 1; | 296 | return 1; |
@@ -338,7 +338,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
338 | sbi->sb = s; | 338 | sbi->sb = s; |
339 | sbi->version = 0; | 339 | sbi->version = 0; |
340 | sbi->sub_version = 0; | 340 | sbi->sub_version = 0; |
341 | sbi->type = AUTOFS_TYPE_INDIRECT; | 341 | set_autofs_type_indirect(&sbi->type); |
342 | sbi->min_proto = 0; | 342 | sbi->min_proto = 0; |
343 | sbi->max_proto = 0; | 343 | sbi->max_proto = 0; |
344 | mutex_init(&sbi->wq_mutex); | 344 | mutex_init(&sbi->wq_mutex); |
@@ -380,7 +380,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
380 | } | 380 | } |
381 | 381 | ||
382 | root_inode->i_fop = &autofs4_root_operations; | 382 | root_inode->i_fop = &autofs4_root_operations; |
383 | root_inode->i_op = sbi->type & AUTOFS_TYPE_TRIGGER ? | 383 | root_inode->i_op = autofs_type_trigger(sbi->type) ? |
384 | &autofs4_direct_root_inode_operations : | 384 | &autofs4_direct_root_inode_operations : |
385 | &autofs4_indirect_root_inode_operations; | 385 | &autofs4_indirect_root_inode_operations; |
386 | 386 | ||
@@ -455,11 +455,7 @@ struct inode *autofs4_get_inode(struct super_block *sb, | |||
455 | if (sb->s_root) { | 455 | if (sb->s_root) { |
456 | inode->i_uid = sb->s_root->d_inode->i_uid; | 456 | inode->i_uid = sb->s_root->d_inode->i_uid; |
457 | inode->i_gid = sb->s_root->d_inode->i_gid; | 457 | inode->i_gid = sb->s_root->d_inode->i_gid; |
458 | } else { | ||
459 | inode->i_uid = 0; | ||
460 | inode->i_gid = 0; | ||
461 | } | 458 | } |
462 | inode->i_blocks = 0; | ||
463 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 459 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
464 | 460 | ||
465 | if (S_ISDIR(inf->mode)) { | 461 | if (S_ISDIR(inf->mode)) { |