diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-16 17:20:23 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-18 01:21:27 -0500 |
commit | 09f12c03fa699ce7d030c47add60577138927d4f (patch) | |
tree | b9ef52e197a38579799ba9b62f78bf0c35efa4cc /fs/autofs4/inode.c | |
parent | 14a2f00bde7668fe18d1c8355d26c7c96961e1f7 (diff) |
autofs4: pass mode to autofs4_get_inode() explicitly
In all cases we'd set inf->mode to know value just before
passing it to autofs4_get_inode(). That kills the need
to store it in autofs_info and pass it to autofs_init_ino()
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs4/inode.c')
-rw-r--r-- | fs/autofs4/inode.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 7421b47b1bb9..6b6f43f00c46 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | 24 | ||
25 | struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | 25 | struct autofs_info *autofs4_init_ino(struct autofs_info *ino, |
26 | struct autofs_sb_info *sbi, mode_t mode) | 26 | struct autofs_sb_info *sbi) |
27 | { | 27 | { |
28 | int reinit = 1; | 28 | int reinit = 1; |
29 | 29 | ||
@@ -47,7 +47,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | |||
47 | 47 | ||
48 | ino->uid = 0; | 48 | ino->uid = 0; |
49 | ino->gid = 0; | 49 | ino->gid = 0; |
50 | ino->mode = mode; | ||
51 | ino->last_used = jiffies; | 50 | ino->last_used = jiffies; |
52 | 51 | ||
53 | ino->sbi = sbi; | 52 | ino->sbi = sbi; |
@@ -258,10 +257,10 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
258 | /* | 257 | /* |
259 | * Get the root inode and dentry, but defer checking for errors. | 258 | * Get the root inode and dentry, but defer checking for errors. |
260 | */ | 259 | */ |
261 | ino = autofs4_init_ino(NULL, sbi, S_IFDIR | 0755); | 260 | ino = autofs4_init_ino(NULL, sbi); |
262 | if (!ino) | 261 | if (!ino) |
263 | goto fail_free; | 262 | goto fail_free; |
264 | root_inode = autofs4_get_inode(s, ino); | 263 | root_inode = autofs4_get_inode(s, ino, S_IFDIR | 0755); |
265 | if (!root_inode) | 264 | if (!root_inode) |
266 | goto fail_ino; | 265 | goto fail_ino; |
267 | 266 | ||
@@ -345,14 +344,15 @@ fail_unlock: | |||
345 | } | 344 | } |
346 | 345 | ||
347 | struct inode *autofs4_get_inode(struct super_block *sb, | 346 | struct inode *autofs4_get_inode(struct super_block *sb, |
348 | struct autofs_info *inf) | 347 | struct autofs_info *inf, |
348 | mode_t mode) | ||
349 | { | 349 | { |
350 | struct inode *inode = new_inode(sb); | 350 | struct inode *inode = new_inode(sb); |
351 | 351 | ||
352 | if (inode == NULL) | 352 | if (inode == NULL) |
353 | return NULL; | 353 | return NULL; |
354 | 354 | ||
355 | inode->i_mode = inf->mode; | 355 | inode->i_mode = mode; |
356 | if (sb->s_root) { | 356 | if (sb->s_root) { |
357 | inode->i_uid = sb->s_root->d_inode->i_uid; | 357 | inode->i_uid = sb->s_root->d_inode->i_uid; |
358 | inode->i_gid = sb->s_root->d_inode->i_gid; | 358 | inode->i_gid = sb->s_root->d_inode->i_gid; |
@@ -360,11 +360,11 @@ struct inode *autofs4_get_inode(struct super_block *sb, | |||
360 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 360 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
361 | inode->i_ino = get_next_ino(); | 361 | inode->i_ino = get_next_ino(); |
362 | 362 | ||
363 | if (S_ISDIR(inf->mode)) { | 363 | if (S_ISDIR(mode)) { |
364 | inode->i_nlink = 2; | 364 | inode->i_nlink = 2; |
365 | inode->i_op = &autofs4_dir_inode_operations; | 365 | inode->i_op = &autofs4_dir_inode_operations; |
366 | inode->i_fop = &autofs4_dir_operations; | 366 | inode->i_fop = &autofs4_dir_operations; |
367 | } else if (S_ISLNK(inf->mode)) { | 367 | } else if (S_ISLNK(mode)) { |
368 | inode->i_size = inf->size; | 368 | inode->i_size = inf->size; |
369 | inode->i_op = &autofs4_symlink_inode_operations; | 369 | inode->i_op = &autofs4_symlink_inode_operations; |
370 | } | 370 | } |